Browse Source
Added the feature to override email templates Added automatic refresh of disk space indicatordevelop
20 changed files with 356 additions and 89 deletions
@ -1,10 +1,9 @@
@@ -1,10 +1,9 @@
|
||||
node_modules |
||||
data |
||||
custom/*.js |
||||
custom/* |
||||
public/dist/*.js |
||||
public/dist/*.map |
||||
public/dist/index.html |
||||
config.js |
||||
*.sublime-workspace |
||||
npm-debug.log |
||||
/custom/images/logo.png |
||||
npm-debug.log |
@ -0,0 +1,45 @@
@@ -0,0 +1,45 @@
|
||||
class AbstractIntervalWorker |
||||
{ |
||||
start(interval) |
||||
{ |
||||
var self = this; |
||||
|
||||
self.stop(); |
||||
self.timer = setInterval(async () => |
||||
{ |
||||
if (self.ticking) |
||||
return; |
||||
|
||||
self.ticking = true; |
||||
try |
||||
{ |
||||
await self.tick(); |
||||
} |
||||
catch (err) |
||||
{ |
||||
console.log(err); |
||||
} |
||||
self.ticking = false; |
||||
}, interval); |
||||
} |
||||
|
||||
|
||||
stop() |
||||
{ |
||||
var self = this; |
||||
if (self.timer) |
||||
{ |
||||
clearInterval(self.timer); |
||||
self.timer = null; |
||||
} |
||||
} |
||||
|
||||
|
||||
/* Implement this: |
||||
async tick() |
||||
{ |
||||
} |
||||
*/ |
||||
} |
||||
|
||||
module.exports = AbstractIntervalWorker; |
@ -0,0 +1,23 @@
@@ -0,0 +1,23 @@
|
||||
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; |
Loading…
Reference in new issue