cleanup eventlog more aggressively

Those login entries are really adding up on old cloudrons
This commit is contained in:
Girish Ramakrishnan
2018-03-22 20:26:45 -07:00
parent f498443cae
commit 26d4a11c44
3 changed files with 6 additions and 20 deletions

View File

@@ -1412,17 +1412,12 @@ describe('database', function () {
}, function (error) {
expect(error).to.be(null);
var actions = [ 'anotherpersistent.event', 'persistent.event' ];
eventlogdb.delByCreationTime(new Date(), actions, function (error) {
eventlogdb.delByCreationTime(new Date(), function (error) {
expect(error).to.be(null);
eventlogdb.getAllPaged([], null, 1, 100, function (error, results) {
expect(error).to.be(null);
expect(results.length).to.be(2);
results = results.sort(function (x, y) { return x.action > y.action; }); // because equal timestamp gives random ordering
expect(results[1].action).to.be.eql('persistent.event');
expect(results[0].action).to.be.eql('anotherpersistent.event');
expect(results.length).to.be(0);
done();
});