Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
hub
overleaf
Commits
ebb9a6c7
Commit
ebb9a6c7
authored
Mar 23, 2017
by
James Allen
Browse files
Improve logging
parent
e1af76f6
Changes
1
Hide whitespace changes
Inline
Side-by-side
migrations/5_remove_holding_accounts.coffee
View file @
ebb9a6c7
...
...
@@ -60,16 +60,17 @@ module.exports = HoldingAccountMigration =
callback
()
run
:
(
done
=
()
->
)
->
console
.
log
"[Getting list of holding accounts]"
HoldingAccountMigration
.
findHoldingAccounts
(
error
,
users
)
->
throw
error
if
error
?
console
.
log
"[Got
list of
holding accounts]"
,
users
.
map
(
u
)
->
u
.
_id
console
.
log
"[Got
#{
users
.
length
}
holding accounts]"
jobs
=
users
.
map
(
u
)
->
(
cb
)
->
HoldingAccountMigration
.
deleteUser
u
.
_id
,
(
error
)
->
return
cb
(
error
)
if
error
?
HoldingAccountMigration
.
deleteUserProjects
u
.
_id
,
(
error
)
->
return
cb
(
error
)
if
error
?
setTimeout
cb
,
20
0
# Small delay to not hammer DB
setTimeout
cb
,
5
0
# Small delay to not hammer DB
async
.
series
jobs
,
(
error
)
->
throw
error
if
error
?
console
.
log
"[FINISHED]"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment