bocoup / skillsbot

Skill Tracking Bot
2 stars 0 forks source link

needless task #55

Closed vitaly-t closed 8 months ago

vitaly-t commented 8 years ago

https://github.com/bocoup/skillsbot/blob/master/src/services/sync-slack.js#L5

returning a transaction from inside a task like this will result in the same as simply returning the transaction, i.e. wrapping a transaction into the task in this case is pointless ;)

You would only do it if there was something else within the task, beside the transaction, but there isn't anything there.

And what makes it worse - you are not using the context correctly, i.e. you are using db.task => db.tx() logic, instead of db.task(t) => t.tx().