Fixed CarmaShots filtering

This commit is contained in:
Vlad Rud 2021-08-17 11:17:51 +03:00
parent 192642383a
commit c8f6679aeb
1 changed files with 3 additions and 2 deletions

View File

@ -25,9 +25,10 @@ const markdowned = s => {
} }
let CarmaShots = [] let CarmaShots = []
const clearInterval = 1000 * 60 * 5
setInterval(() => { setInterval(() => {
const oldShots = CarmaShots.filter() CarmaShots = CarmaShots.filter(obj => (Date.now() - obj.date) < clearInterval)
}, 1000 * 60 * 5) }, clearInterval)
const mongo_uri = "mongodb://"+process.env.MONGO_HOST+"/godot" const mongo_uri = "mongodb://"+process.env.MONGO_HOST+"/godot"
mongoose.connect(mongo_uri, {useNewUrlParser: true, useUnifiedTopology: true}) mongoose.connect(mongo_uri, {useNewUrlParser: true, useUnifiedTopology: true})