mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
feat: increase daily upload limit
This commit is contained in:
parent
67c5de6512
commit
56b87672fd
2 changed files with 6 additions and 1 deletions
|
|
@ -16,7 +16,6 @@ import {
|
|||
generateUploadSignedUrl,
|
||||
} from '../../utils/uploads'
|
||||
|
||||
const MAX_DAILY_UPLOADS = 1
|
||||
const VALID_CONTENT_TYPES = ['text/csv', 'application/zip']
|
||||
|
||||
const extensionForContentType = (contentType: string) => {
|
||||
|
|
@ -61,6 +60,7 @@ export const uploadImportFileResolver = authorized<
|
|||
const dirPath = `imports/${uid}/${dateStr}/`
|
||||
const fileCount = await countOfFilesWithPrefix(dirPath)
|
||||
|
||||
const MAX_DAILY_UPLOADS = env.fileUpload.dailyUploadLimit
|
||||
if (fileCount >= MAX_DAILY_UPLOADS) {
|
||||
return {
|
||||
errorCodes: [UploadImportFileErrorCode.UploadDailyLimitExceeded],
|
||||
|
|
|
|||
|
|
@ -81,6 +81,7 @@ export interface BackendEnv {
|
|||
gcsUploadBucket: string
|
||||
gcsUploadSAKeyFilePath: string
|
||||
gcsUploadPrivateBucket: string
|
||||
dailyUploadLimit: number
|
||||
}
|
||||
sender: {
|
||||
message: string
|
||||
|
|
@ -144,6 +145,7 @@ const nullableEnvVars = [
|
|||
'POSTHOG_API_KEY',
|
||||
'TWITTER_BEARER_TOKEN',
|
||||
'GCS_UPLOAD_PRIVATE_BUCKET',
|
||||
'GCS_UPLOAD_DAILY_LIMIT',
|
||||
'SENDER_MESSAGE',
|
||||
'SENDER_FEEDBACK',
|
||||
'SENDER_GENERAL',
|
||||
|
|
@ -275,6 +277,9 @@ export function getEnv(): BackendEnv {
|
|||
gcsUploadBucket: parse('GCS_UPLOAD_BUCKET'),
|
||||
gcsUploadSAKeyFilePath: parse('GCS_UPLOAD_SA_KEY_FILE_PATH'),
|
||||
gcsUploadPrivateBucket: parse('GCS_UPLOAD_PRIVATE_BUCKET'),
|
||||
dailyUploadLimit: parse('GCS_UPLOAD_DAILY_LIMIT')
|
||||
? parseInt(parse('GCS_UPLOAD_DAILY_LIMIT'), 10)
|
||||
: 30, // default to 30
|
||||
}
|
||||
const sender = {
|
||||
message: parse('SENDER_MESSAGE'),
|
||||
|
|
|
|||
Loading…
Reference in a new issue