Skip to content

Commit

Permalink
SERVICES-1085 fix case when timestamp not spported by DB
Browse files Browse the repository at this point in the history
  • Loading branch information
johnykes committed Mar 16, 2023
1 parent 8cf8172 commit 1af13b3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/config/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@
"elasticMaxBatch": 10000,
"dbBatch": 1000,
"complexityLevel": 200,
"getLogsFromElasticBatchSize": 1000
"getLogsFromElasticBatchSize": 1000,
"dbMaxTimestamp": 2147483647
},
"elasticDictionary": {
"scamInfo": {
Expand Down
10 changes: 9 additions & 1 deletion src/modules/marketplaces/marketplaces-reindex.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,15 @@ export class MarketplacesReindexService {
private async addMarketplaceStateToDb(
marketplaceReindexState: MarketplaceReindexState,
): Promise<void> {
marketplaceReindexState.auctions.map((a) => delete a.id);
marketplaceReindexState.auctions.map((a) => {
delete a.id;
if (a.startDate > constants.dbMaxTimestamp) {
a.startDate = constants.dbMaxTimestamp;
}
if (a.endDate > constants.dbMaxTimestamp) {
a.endDate = constants.dbMaxTimestamp;
}
});
marketplaceReindexState.orders.map((o) => delete o.id);
marketplaceReindexState.offers.map((o) => delete o.id);

Expand Down

0 comments on commit 1af13b3

Please sign in to comment.