Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions server/api/knowledgeBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ export const CreateCollectionApi = async (c: Context) => {
},
{
retryLimit: 3,
expireInHours: 12,
expireInSeconds: 43200,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For better readability and maintainability, it's recommended to avoid using magic numbers. The value 43200 can be expressed as a calculation, which makes the intent clearer. This is consistent with the approach taken in server/api/oauth.ts (JobExpiryHours * 3600). This comment also applies to other occurrences of 43200 in this file.

        expireInSeconds: 12 * 60 * 60,

},
)
loggerWithChild({ email: userEmail }).info(
Expand Down Expand Up @@ -926,7 +926,7 @@ export const CreateFolderApi = async (c: Context) => {
},
{
retryLimit: 3,
expireInHours: 12,
expireInSeconds: 43200,
},
)

Expand Down Expand Up @@ -1076,7 +1076,7 @@ async function ensureFolderPath(
},
{
retryLimit: 3,
expireInHours: 12,
expireInSeconds: 43200,
},
)

Expand Down Expand Up @@ -1538,7 +1538,7 @@ export const UploadFilesApi = async (c: Context) => {
{ fileId: item.id, type: ProcessingJobType.FILE },
{
retryLimit: 3,
expireInHours: 12,
expireInSeconds: 43200,
},
)

Expand Down
2 changes: 1 addition & 1 deletion server/api/oauth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ export const OAuthCallback = async (c: Context) => {
}
// Enqueue the background job within the same transaction
const jobId = await boss.send(SaaSQueue, SaasJobPayload, {
expireInHours: JobExpiryHours,
expireInSeconds: JobExpiryHours * 3600,
})
loggerWithChild({ email: email }).info(
`Job ${jobId} enqueued for connection ${connector.id}`,
Expand Down
Loading