Skip to content

Commit

Permalink
Merge pull request #14 from dokithonon/main
Browse files Browse the repository at this point in the history
compatibility with meteor 2.6
  • Loading branch information
Nathan Schwarz committed Apr 14, 2022
2 parents 6ea7211 + 3b07e15 commit 1ef68e4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/TaskQueue.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ import { logger, errorLogger } from './logs'
class MongoTaskQueue extends Mongo.Collection {
// verify that the collection indexes are set
_setIndexes() {
this.rawCollection().ensureIndex({ taskType: 1 })
this.rawCollection().ensureIndex({ onGoing: 1 })
this.rawCollection().createIndex({ taskType: 1 })
this.rawCollection().createIndex({ onGoing: 1 })
// remove post @1.2 index if it exists
this.rawCollection().dropIndex({ priority: -1, createdAt: 1 }).catch(e => e)

// add dueDate index for scheduled tasks in @1.2; add dueDate field to prior @1.2 tasks
this.update({ dueDate: null }, { $set: { dueDate: new Date() }}, { multi: true })
this.rawCollection().ensureIndex({ dueDate: 1, priority: -1, createdAt: 1 })
this.rawCollection().createIndex({ dueDate: 1, priority: -1, createdAt: 1 })
}
constructor(props) {
super(props)
Expand Down

0 comments on commit 1ef68e4

Please sign in to comment.