Skip to content

Commit

Permalink
final deployment fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Segfaultd committed Feb 14, 2024
1 parent a7bad10 commit a9e64a9
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 34 deletions.
9 changes: 6 additions & 3 deletions src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,12 @@ async function bootstrap() {
host: redisUrl[0].host,
port: redisUrl[0].port,
password: redisUrl[0].password,
tls: {
rejectUnauthorized: false,
},
tls:
process.env.ENV === 'production'
? {
rejectUnauthorized: false,
}
: null,
},
},
{ inheritAppConfig: true },
Expand Down
2 changes: 2 additions & 0 deletions src/async/consumers/beam.consumer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,7 @@ export class BeamConsumer {

this._logger.debug(`Updated beam event ${job.data.url}`);
}

return beam;
}
}
2 changes: 2 additions & 0 deletions src/async/consumers/block.consumer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,8 @@ export class BlockConsumer {
data: blockDoc,
});
}

return blockDoc;
} catch (error) {
this._logger.error(`Failed to ingest block ${job.data.blockHeight}: ${error}`, error.stack);
throw error;
Expand Down
1 change: 1 addition & 0 deletions src/async/consumers/millions-deposit.consumer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export class MillionsDepositConsumer {

try {
await this._millionsDepositService.update(formattedMillionsDeposit);
return formattedMillionsDeposit;
} catch {
this._logger.error(`MillionsDepositEntity with id ${job.data.id} does not exist`);
return;
Expand Down
65 changes: 40 additions & 25 deletions src/async/queues.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@ export const AsyncQueues: BullModuleAsyncOptions[] = [
inject: [ConfigService],
useFactory: (configService: ConfigService) => ({
url: configService.get<string>('REDIS_URL'),
redis: {
tls: {
rejectUnauthorized: false,
},
},
redis:
configService.get<string>('ENV') === 'production'
? {
tls: {
rejectUnauthorized: false,
},
}
: {},
limiter: {
max: 1,
duration: 30,
Expand All @@ -31,11 +34,14 @@ export const AsyncQueues: BullModuleAsyncOptions[] = [
inject: [ConfigService],
useFactory: (configService: ConfigService) => ({
url: configService.get<string>('REDIS_URL'),
redis: {
tls: {
rejectUnauthorized: false,
},
},
redis:
configService.get<string>('ENV') === 'production'
? {
tls: {
rejectUnauthorized: false,
},
}
: {},
defaultJobOptions: {
removeOnComplete: false,
removeOnFail: false,
Expand All @@ -48,11 +54,14 @@ export const AsyncQueues: BullModuleAsyncOptions[] = [
inject: [ConfigService],
useFactory: (configService: ConfigService) => ({
url: configService.get<string>('REDIS_URL'),
redis: {
tls: {
rejectUnauthorized: false,
},
},
redis:
configService.get<string>('ENV') === 'production'
? {
tls: {
rejectUnauthorized: false,
},
}
: {},
defaultJobOptions: {
removeOnComplete: false,
removeOnFail: false,
Expand All @@ -65,11 +74,14 @@ export const AsyncQueues: BullModuleAsyncOptions[] = [
inject: [ConfigService],
useFactory: (configService: ConfigService) => ({
url: configService.get<string>('REDIS_URL'),
redis: {
tls: {
rejectUnauthorized: false,
},
},
redis:
configService.get<string>('ENV') === 'production'
? {
tls: {
rejectUnauthorized: false,
},
}
: {},
defaultJobOptions: {
removeOnComplete: false,
removeOnFail: false,
Expand All @@ -82,11 +94,14 @@ export const AsyncQueues: BullModuleAsyncOptions[] = [
inject: [ConfigService],
useFactory: (configService: ConfigService) => ({
url: configService.get<string>('REDIS_URL'),
redis: {
tls: {
rejectUnauthorized: false,
},
},
redis:
configService.get<string>('ENV') === 'production'
? {
tls: {
rejectUnauthorized: false,
},
}
: {},
limiter: {
max: 1,
duration: 30,
Expand Down
9 changes: 6 additions & 3 deletions src/sync_consumer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ async function bootstrap() {
host: redisUrl[0].host,
port: redisUrl[0].port,
password: redisUrl[0].password,
tls: {
rejectUnauthorized: false,
},
tls:
process.env.ENV === 'production'
? {
rejectUnauthorized: false,
}
: null,
},
});

Expand Down
9 changes: 6 additions & 3 deletions src/sync_scheduler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ async function bootstrap() {
host: redisUrl[0].host,
port: redisUrl[0].port,
password: redisUrl[0].password,
tls: {
rejectUnauthorized: false,
},
tls:
process.env.ENV === 'production'
? {
rejectUnauthorized: false,
}
: null,
},
});

Expand Down

0 comments on commit a9e64a9

Please sign in to comment.