-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add bullmq * Fix yarn.lock * Bump rimraf latest
- Loading branch information
Showing
3 changed files
with
100 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
const { BULL_REDIS_CONNECTION } = process.env; | ||
|
||
if (!BULL_REDIS_CONNECTION) { | ||
console.log('Skipping bullmq integration test'); | ||
console.log('Create cache on redislabs.com and export BULL_REDIS_CONNECTION="redis://:password@hostname:port"'); | ||
return; | ||
} | ||
|
||
const url = new URL(BULL_REDIS_CONNECTION); | ||
const connection = { | ||
username: url.username, | ||
password: url.password, | ||
host: url.hostname, | ||
port: Number(url.port), | ||
} | ||
|
||
const { Queue } = require('bullmq'); | ||
|
||
async function main() { | ||
const queue = new Queue('foo', { connection }); | ||
await queue.add('job', { id: 'one' }); | ||
await queue.add('job', { id: 'two' }); | ||
await queue.close(); | ||
} | ||
|
||
main().then(() => console.log('bullmq success')).catch(console.error); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters