2023-07-31 14:34:36 +02:00
|
|
|
import { GeoIP } from '@server/helpers/geo-ip.js'
|
|
|
|
import { SCHEDULER_INTERVALS_MS } from '../../initializers/constants.js'
|
|
|
|
import { AbstractScheduler } from './abstract-scheduler.js'
|
2022-03-24 13:36:47 +01:00
|
|
|
|
|
|
|
export class GeoIPUpdateScheduler extends AbstractScheduler {
|
|
|
|
|
|
|
|
private static instance: AbstractScheduler
|
|
|
|
|
2022-05-24 14:55:07 +02:00
|
|
|
protected schedulerIntervalMs = SCHEDULER_INTERVALS_MS.GEO_IP_UPDATE
|
2022-03-24 13:36:47 +01:00
|
|
|
|
|
|
|
private constructor () {
|
|
|
|
super()
|
|
|
|
}
|
|
|
|
|
|
|
|
protected internalExecute () {
|
2023-12-28 09:12:20 +01:00
|
|
|
return GeoIP.Instance.updateDatabases()
|
2022-03-24 13:36:47 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static get Instance () {
|
|
|
|
return this.instance || (this.instance = new this())
|
|
|
|
}
|
|
|
|
}
|