23 lines
423 B
JavaScript
23 lines
423 B
JavaScript
|
const async = require('async');
|
||
|
const AbstractIntervalWorker = require('./abstractintervalworker');
|
||
|
|
||
|
|
||
|
class ExpirationWorker extends AbstractIntervalWorker
|
||
|
{
|
||
|
constructor(repository)
|
||
|
{
|
||
|
super();
|
||
|
this.repository = repository;
|
||
|
}
|
||
|
|
||
|
|
||
|
async tick()
|
||
|
{
|
||
|
var self = this;
|
||
|
|
||
|
await self.repository.uploads.deleteExpired();
|
||
|
await self.repository.codes.deleteExpired();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
module.exports = ExpirationWorker;
|