Skip to content

Commit

Permalink
Merge pull request #107 from reservoirprotocol/ofir/platf-2065-stop-o…
Browse files Browse the repository at this point in the history
…pensea-order-ingestion-for-goerli

feat: added env var
  • Loading branch information
nofir authored Aug 16, 2023
2 parents d9bb31f + 247e761 commit 5575b80
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/common/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const log = (level: "debug" | "error" | "info" | "warn") => {
case 8453:
network = "base";
break;

case 84531:
network = "base-goerli";
break;
Expand Down
2 changes: 2 additions & 0 deletions src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ export const config = {
doRealtimeWork: Boolean(Number(process.env.DO_REALTIME_WORK)),
doLiveWork: Boolean(Number(process.env.DO_LIVE_WORK)),

doOpenseaWork: Boolean(Number(process.env.DO_OPENSEA_WORK)),

databaseUrl: String(process.env.DATABASE_URL),
redisUrl: String(process.env.REDIS_URL),
};
2 changes: 1 addition & 1 deletion src/jobs/seaport-sync/backfill-queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const backfillQueue = new Queue(BACKFILL_QUEUE_NAME, {
});
new QueueScheduler(BACKFILL_QUEUE_NAME, { connection: redis.duplicate() });

if (config.doBackfillWork) {
if (config.doBackfillWork && config.doOpenseaWork) {
const backfillWorker = new Worker(
BACKFILL_QUEUE_NAME,
async (job: Job) => {
Expand Down
2 changes: 1 addition & 1 deletion src/jobs/seaport-sync/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import * as seaportSyncRealtimeListings from "./realtime-queue";

import * as seaportSyncBackfill from "./backfill-queue";

if (config.doRealtimeWork) {
if (config.doRealtimeWork && config.doOpenseaWork) {
cron.schedule("*/5 * * * * *", async () => {
const lockAcquired = await acquireLock("seaport-sync-lock", 60);

Expand Down
2 changes: 1 addition & 1 deletion src/jobs/seaport-sync/realtime-queue-collection-offers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const realtimeQueue = new Queue(REALTIME_QUEUE_NAME, {
});
new QueueScheduler(REALTIME_QUEUE_NAME, { connection: redis.duplicate() });

if (config.doRealtimeWork && config.collectionsOffersOpenseaApiKey !== "") {
if (config.doRealtimeWork && config.doOpenseaWork && config.collectionsOffersOpenseaApiKey !== "") {
const realtimeWorker = new Worker(
REALTIME_QUEUE_NAME,
async (job: Job) => {
Expand Down
2 changes: 1 addition & 1 deletion src/jobs/seaport-sync/realtime-queue-offers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const realtimeQueue = new Queue(REALTIME_QUEUE_NAME, {
});
new QueueScheduler(REALTIME_QUEUE_NAME, { connection: redis.duplicate() });

if (config.doRealtimeWork && config.offersOpenseaApiKey !== "") {
if (config.doRealtimeWork && config.doOpenseaWork && config.offersOpenseaApiKey !== "") {
const realtimeWorker = new Worker(
REALTIME_QUEUE_NAME,
async (job: Job) => {
Expand Down
2 changes: 1 addition & 1 deletion src/jobs/seaport-sync/realtime-queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const realtimeQueue = new Queue(REALTIME_QUEUE_NAME, {
});
new QueueScheduler(REALTIME_QUEUE_NAME, { connection: redis.duplicate() });

if (config.doRealtimeWork) {
if (config.doRealtimeWork && config.doOpenseaWork) {
const realtimeWorker = new Worker(
REALTIME_QUEUE_NAME,
async (job: Job) => {
Expand Down

0 comments on commit 5575b80

Please sign in to comment.