Skip to content

Commit

Permalink
Update unstaked.service.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
RiXelanya committed Sep 25, 2023
1 parent 7682997 commit bd876cc
Showing 1 changed file with 2 additions and 25 deletions.
27 changes: 2 additions & 25 deletions src/schedulers/unstaked/unstaked.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export class UnstakedService implements OnModuleInit {
],
},
from: 0,
size: 10,
size: 1000,
});

const listRequestService = createRequestService.body.hits.hits;
Expand All @@ -89,30 +89,7 @@ export class UnstakedService implements OnModuleInit {
},
},
});
} else {
const timeWaitingUnstaked: string =
requestService['_source']['request']['unstaked_at'];

if (!timeWaitingUnstaked) {
continue;
}

const numberTimeWaitingUnstaked = Number(
timeWaitingUnstaked.replace(/,/gi, ''),
);

const timeNext6Days = numberTimeWaitingUnstaked + this.timer;
const timeNow = new Date().getTime();
const diffTime = timeNext6Days - timeNow;

if (diffTime <= 0) {
await retrieveUnstakedAmount(
this.subtrateService.api as any,
this.subtrateService.pair,
requestId,
);
}
}
}

Check failure on line 92 in src/schedulers/unstaked/unstaked.service.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js 16 ( lint:check )

Delete `·`
}
} catch (err) {
this.logger.error(`unstaked error ${err}`);
Expand Down

0 comments on commit bd876cc

Please sign in to comment.