Refactor code
This commit is contained in:
parent
504718f489
commit
16aad82857
|
@ -10,8 +10,7 @@ export default class Counter {
|
|||
}
|
||||
|
||||
get(item) {
|
||||
const count = this.map.get(item) || 0;
|
||||
return count;
|
||||
return this.map.get(item) || 0;
|
||||
}
|
||||
|
||||
add(item) {
|
||||
|
|
|
@ -60,13 +60,11 @@ function initializeDailyCron() {
|
|||
const lastRun = now.getTime()
|
||||
- now.getUTCHours() * HOUR
|
||||
- (now.getUTCMinutes() * 60 + now.getUTCSeconds()) * 1000;
|
||||
const cron = new Cron(24, lastRun);
|
||||
return cron;
|
||||
return new Cron(24, lastRun);
|
||||
}
|
||||
|
||||
function initializeHourlyCron() {
|
||||
const cron = new Cron(1);
|
||||
return cron;
|
||||
return new Cron(1);
|
||||
}
|
||||
|
||||
export const DailyCron = initializeDailyCron();
|
||||
|
|
Loading…
Reference in New Issue
Block a user