Skip to content

Commit

Permalink
fix(shuttle): Fix example app to work with Shuttle 0.5.0+
Browse files Browse the repository at this point in the history
Our build process didn't catch this. Will need to investigate
separately.
  • Loading branch information
sds committed Jul 10, 2024
1 parent 1320371 commit 5e71bcb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/shuttle/src/example-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"main": "./app.ts",
"license": "MIT",
"dependencies": {
"@farcaster/shuttle": "^0.2.0",
"@farcaster/shuttle": "^0.5.0",
"@figma/hot-shots": "^9.0.0-figma.1",
"commander": "^11.0.0",
"ioredis": "^5.3.2",
Expand Down
6 changes: 3 additions & 3 deletions packages/shuttle/src/example-app/worker.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Redis } from "ioredis";
import { Cluster, Redis } from "ioredis";
import { Job, Queue, Worker } from "bullmq";
import { App } from "./app";
import { pino } from "pino";

const QUEUE_NAME = "default";

export function getWorker(app: App, redis: Redis, log: pino.Logger, concurrency = 1) {
export function getWorker(app: App, redis: Redis | Cluster, log: pino.Logger, concurrency = 1) {
const worker = new Worker(
QUEUE_NAME,
async (job: Job) => {
Expand Down Expand Up @@ -38,7 +38,7 @@ export function getWorker(app: App, redis: Redis, log: pino.Logger, concurrency
return worker;
}

export function getQueue(redis: Redis) {
export function getQueue(redis: Redis | Cluster) {
return new Queue("default", {
connection: redis,
defaultJobOptions: { attempts: 3, backoff: { delay: 1000, type: "exponential" } },
Expand Down

0 comments on commit 5e71bcb

Please sign in to comment.