mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-10-19 22:27:20 +02:00
Fix BullMQ removal processor arguments (#783)
This commit is contained in:
1 parent
35c3b1804b
commit
7b585fdefd
4 files changed
+75
-2
No files matched your search
@@ -31,4 +31,15 @@ export async function processRemoveCache(
|
||||
}
|
||||
}
|
||||
|
||||
export default processRemoveCache;
|
||||
/**
|
||||
* BullMQ passes its lock token as the second processor argument. Do not let
|
||||
* that token occupy the database-injection slot used by processRemoveCache.
|
||||
*/
|
||||
export function createRemoveCacheProcessor(database?: Database) {
|
||||
return async (
|
||||
job: SandboxedJob<RepoJobData, void>,
|
||||
_lockToken?: string
|
||||
) => processRemoveCache(job, database);
|
||||
}
|
||||
|
||||
export default createRemoveCacheProcessor();
|
||||
@@ -50,4 +50,15 @@ export async function processRemoveRepository(
|
||||
}
|
||||
}
|
||||
|
||||
export default processRemoveRepository;
|
||||
/**
|
||||
* BullMQ calls sandbox processors with (job, lockToken). Keep that transport
|
||||
* signature separate from the injectable worker function used by tests.
|
||||
*/
|
||||
export function createRemoveRepositoryProcessor(database?: Database) {
|
||||
return async (
|
||||
job: SandboxedJob<RepoJobData, void>,
|
||||
_lockToken?: string
|
||||
) => processRemoveRepository(job, database);
|
||||
}
|
||||
|
||||
export default createRemoveRepositoryProcessor();
|
||||
Reference in new issue
Block a user