fix(youtube-import): export proxyQueue singleton for clean SIGTERM shutdown (issue #94 bug 7)
This commit is contained in:
parent
cb0efdfdae
commit
6eb98d866b
1 changed files with 5 additions and 2 deletions
|
|
@ -19,8 +19,11 @@ const parseRedisUrl = (url) => {
|
|||
return { host: parsed.hostname, port: parseInt(parsed.port, 10) };
|
||||
};
|
||||
|
||||
// Hand off to the existing proxy queue once the original is in S3.
|
||||
const proxyQueue = new Queue('proxy', {
|
||||
// BUG FIX #7: Keep proxyQueue as a module-level singleton so it is only
|
||||
// opened once and can be closed on SIGTERM (via the exported closer).
|
||||
// Previously the worker created a new Queue on every job invocation; each
|
||||
// BullMQ Queue holds an open Redis connection that prevented clean shutdown.
|
||||
export const proxyQueue = new Queue('proxy', {
|
||||
connection: parseRedisUrl(process.env.REDIS_URL || 'redis://queue:6379'),
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue