mirror of
https://github.com/apricote/Listory.git
synced 2026-02-07 02:07:03 +00:00
feat: optimize db queries (#297)
This commit is contained in:
parent
fd28daa37a
commit
dd57a52ab6
5 changed files with 104 additions and 33 deletions
|
|
@ -53,7 +53,7 @@ export class SchedulerService implements OnApplicationBootstrap {
|
|||
const INACTIVE_CUTOFF_MSEC = 60 * 60 * 1000;
|
||||
|
||||
await Promise.all(
|
||||
userInfo.map(({ user, lastListen }) => {
|
||||
userInfo.map(({ userID, lastListen }) => {
|
||||
let pollRate = POLL_RATE_INACTIVE_SEC;
|
||||
|
||||
const timeSinceLastListen = new Date().getTime() - lastListen.getTime();
|
||||
|
|
@ -62,10 +62,10 @@ export class SchedulerService implements OnApplicationBootstrap {
|
|||
}
|
||||
|
||||
this.importSpotifyJobService.sendThrottled(
|
||||
{ userID: user.id },
|
||||
{ userID },
|
||||
{},
|
||||
pollRate,
|
||||
user.id,
|
||||
userID,
|
||||
);
|
||||
}),
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue