mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
fix: save url operation is delayed
This commit is contained in:
parent
40327a5001
commit
927394e07c
3 changed files with 6 additions and 1 deletions
|
|
@ -283,6 +283,7 @@ export const enqueueParseRequest = async ({
|
|||
publishedAt,
|
||||
folder,
|
||||
rssFeedUrl,
|
||||
priority,
|
||||
}
|
||||
|
||||
// If there is no Google Cloud Project Id exposed, it means that we are in local environment
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ interface savePageJob {
|
|||
data: unknown
|
||||
isRss: boolean
|
||||
isImport: boolean
|
||||
priority: 'low' | 'high'
|
||||
}
|
||||
|
||||
const queue = new Queue(QUEUE_NAME, {
|
||||
|
|
@ -29,7 +30,7 @@ const getPriority = (job: savePageJob): number => {
|
|||
return 100
|
||||
}
|
||||
|
||||
return 1
|
||||
return job.priority === 'low' ? 10 : 1
|
||||
}
|
||||
|
||||
const getAttempts = (job: savePageJob): number => {
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ interface RequestBody {
|
|||
publishedAt?: string
|
||||
folder?: string
|
||||
users?: User[]
|
||||
priority: 'high' | 'low'
|
||||
}
|
||||
|
||||
interface LogRecord {
|
||||
|
|
@ -88,6 +89,7 @@ export const contentFetchRequestHandler: RequestHandler = async (req, res) => {
|
|||
const rssFeedUrl = body.rssFeedUrl
|
||||
const savedAt = body.savedAt
|
||||
const publishedAt = body.publishedAt
|
||||
const priority = body.priority
|
||||
|
||||
const logRecord: LogRecord = {
|
||||
url,
|
||||
|
|
@ -130,6 +132,7 @@ export const contentFetchRequestHandler: RequestHandler = async (req, res) => {
|
|||
},
|
||||
isRss: !!rssFeedUrl,
|
||||
isImport: !!taskId,
|
||||
priority,
|
||||
}))
|
||||
|
||||
const cacheResult = await cacheFetchResult(fetchResult)
|
||||
|
|
|
|||
Loading…
Reference in a new issue