Skip to content

Commit

Permalink
Fixing redis queue for tests by adding prefix (#921)
Browse files Browse the repository at this point in the history
* fixing redis queue for tests by adding prefix

* changing queue prefix for redis prefix so that it fixes it for all redis keys for tests

* Revert "changing queue prefix for redis prefix so that it fixes it for all redis keys for tests"

This reverts commit 32ff62d.
  • Loading branch information
mboudreau committed Nov 18, 2021
1 parent 469874e commit 6ed633b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions .env.test
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ SQS_BACKFILL_QUEUE_URL=http://127.0.0.1:4566/000000000000/test-backfill
SQS_BACKFILL_QUEUE_REGION=us-west-1
SQS_PUSH_QUEUE_URL=http://127.0.0.1:4566/000000000000/test-push
SQS_PUSH_QUEUE_REGION=us-west-1
BULL_QUEUE_PREFIX=bulltest

MICROS_AWS_REGION=us-west-1

Expand Down
1 change: 1 addition & 0 deletions src/config/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ export interface EnvVars {
GIT_BRANCH_NAME?: string;
GITHUB_REPO_URL: string;
DEPLOYMENT_DATE: string;
BULL_QUEUE_PREFIX?: string;

// Test Vars
ATLASSIAN_SECRET?: string;
Expand Down
2 changes: 2 additions & 0 deletions src/worker/queues.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import * as Sentry from "@sentry/node";
import statsd from "../config/statsd";
import { getLogger } from "../config/logger";
import {metricError, redisQueueMetrics} from "../config/metric-names";
import envVars from "../config/env";

const client = new Redis(getRedisInfo("client"));
const subscriber = new Redis(getRedisInfo("subscriber"));
Expand All @@ -26,6 +27,7 @@ const getQueueOptions = (timeout: number): QueueOptions => {
removeOnComplete: true,
removeOnFail: true
},
prefix: envVars.BULL_QUEUE_PREFIX,
settings: {
// lockDuration must be greater than the timeout, so that it doesn't get processed again prematurely
lockDuration: timeout + 500
Expand Down

0 comments on commit 6ed633b

Please sign in to comment.