finish borked swisses

pull/7011/head
Thibault Duplessis 2020-05-22 11:21:32 -06:00
parent 01e5268602
commit e4debcb680
1 changed files with 14 additions and 0 deletions

View File

@ -0,0 +1,14 @@
db.swiss.find({featurable:true,startsAt:{$lt:new Date(Date.now() - 1000 * 3600 * 24)},'settings.i':{$lt:3600 * 24}}).forEach(s => {
print(`${s._id} ${s.name} round:${s.round}`);
db.swiss.update({_id:s._id},{
$set:{
finishedAt: new Date(),
'settings.n': s.round,
canceled: new Date()
},
$unset:{
nextRoundAt: 1,
featurable: 1
}
});
});