mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #15080 from overleaf/msm-configurable-upload-timeout
[web] Add configurable project upload timeout GitOrigin-RevId: da26d7edbce9169c92cc3bc8746cb42e5c0e4919
This commit is contained in:
parent
e8dcef50db
commit
22531969f6
5 changed files with 11 additions and 2 deletions
|
@ -393,6 +393,7 @@ module.exports = function (webRouter, privateApiRouter, publicApiRouter) {
|
|||
emailConfirmationDisabled: Settings.emailConfirmationDisabled,
|
||||
maxEntitiesPerProject: Settings.maxEntitiesPerProject,
|
||||
maxUploadSize: Settings.maxUploadSize,
|
||||
projectUploadTimeout: Settings.projectUploadTimeout,
|
||||
recaptchaSiteKey: Settings.recaptcha?.siteKey,
|
||||
recaptchaSiteKeyV3: Settings.recaptcha?.siteKeyV3,
|
||||
recaptchaDisabled: Settings.recaptcha?.disabled,
|
||||
|
|
|
@ -306,6 +306,10 @@ module.exports = {
|
|||
|
||||
maxEntitiesPerProject: 2000,
|
||||
|
||||
projectUploadTimeout: parseInt(
|
||||
process.env.PROJECT_UPLOAD_TIMEOUT || '120000',
|
||||
10
|
||||
),
|
||||
maxUploadSize: 50 * 1024 * 1024, // 50 MB
|
||||
multerOptions: {
|
||||
preservePath: process.env.MULTER_PRESERVE_PATH,
|
||||
|
|
|
@ -22,7 +22,9 @@ type UploadProjectModalProps = {
|
|||
|
||||
function UploadProjectModal({ onHide }: UploadProjectModalProps) {
|
||||
const { t } = useTranslation()
|
||||
const { maxUploadSize } = getMeta('ol-ExposedSettings') as ExposedSettings
|
||||
const { maxUploadSize, projectUploadTimeout } = getMeta(
|
||||
'ol-ExposedSettings'
|
||||
) as ExposedSettings
|
||||
const [ableToUpload, setAbleToUpload] = useState(false)
|
||||
const location = useLocation()
|
||||
|
||||
|
@ -42,7 +44,7 @@ function UploadProjectModal({ onHide }: UploadProjectModalProps) {
|
|||
},
|
||||
limit: 1,
|
||||
fieldName: 'qqfile', // "qqfile" is needed for our express multer middleware
|
||||
timeout: 120000,
|
||||
timeout: projectUploadTimeout,
|
||||
})
|
||||
.on('file-added', () => {
|
||||
// this function can be invoked multiple times depending on maxNumberOfFiles
|
||||
|
|
|
@ -188,6 +188,7 @@ const initialize = () => {
|
|||
],
|
||||
editableFilenames: ['latexmkrc', '.latexmkrc', 'makefile', 'gnumakefile'],
|
||||
validRootDocExtensions: ['tex', 'Rtex', 'ltx', 'Rnw'],
|
||||
projectUploadTimeout: 12000,
|
||||
}
|
||||
|
||||
window.project_id = project._id
|
||||
|
|
|
@ -21,6 +21,7 @@ export type ExposedSettings = {
|
|||
hasSamlFeature: boolean
|
||||
isOverleaf: boolean
|
||||
maxEntitiesPerProject: number
|
||||
projectUploadTimeout: number
|
||||
maxUploadSize: number
|
||||
recaptchaDisabled: {
|
||||
invite: boolean
|
||||
|
|
Loading…
Reference in a new issue