mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Only set keys in migration if they exist
This commit is contained in:
parent
bd392f5682
commit
4f34cb7363
1 changed files with 6 additions and 3 deletions
|
@ -130,12 +130,15 @@ module.exports = RedisManager =
|
|||
return callback(error) if error?
|
||||
[lines, version, ops, project_id] = results
|
||||
multi = rclient.multi()
|
||||
multi.set keys.docLines(doc_id:doc_id), lines
|
||||
multi.set keys.docVersion(doc_id:doc_id), version
|
||||
if lines?
|
||||
multi.set keys.docLines(doc_id:doc_id), lines
|
||||
if version?
|
||||
multi.set keys.docVersion(doc_id:doc_id), version
|
||||
multi.del keys.docOps(doc_id:doc_id)
|
||||
if ops.length > 0
|
||||
multi.rpush keys.docOps(doc_id:doc_id), ops...
|
||||
multi.set keys.projectKey(doc_id:doc_id), project_id
|
||||
if project_id?
|
||||
multi.set keys.projectKey(doc_id:doc_id), project_id
|
||||
multi.exec (error) ->
|
||||
return callback(error) if error?
|
||||
return callback null, project_id
|
||||
|
|
Loading…
Reference in a new issue