updated sequelize

This commit is contained in:
mserranom
2020-03-16 16:31:02 +01:00
parent 3ff9c18dcb
commit 6f837f1a74
4 changed files with 52 additions and 64 deletions

View File

@@ -32,7 +32,7 @@ module.exports = ProjectPersistenceManager = {
db.Project.findOrCreate({ where: { project_id } })
.spread((project, created) =>
project
.updateAttributes({ lastAccessed: new Date() })
.update({ lastAccessed: new Date() })
.then(() => cb())
.error(cb)
)

View File

@@ -227,7 +227,7 @@ module.exports = UrlCache = {
callback = function(error, urlDetails) {}
}
const job = cb =>
db.UrlCache.find({ where: { url, project_id } })
db.UrlCache.findOne({ where: { url, project_id } })
.then(urlDetails => cb(null, urlDetails))
.error(cb)
return dbQueue.queue.push(job, callback)
@@ -241,7 +241,7 @@ module.exports = UrlCache = {
db.UrlCache.findOrCreate({ where: { url, project_id } })
.spread((urlDetails, created) =>
urlDetails
.updateAttributes({ lastModified })
.update({ lastModified })
.then(() => cb())
.error(cb)
)