add user.created, spawner.started

- alembic revision
- in user/spawner models
This commit is contained in:
Min RK
2018-03-21 14:24:25 +01:00
parent fd40e27be4
commit 9dc24c0995
5 changed files with 59 additions and 3 deletions

View File

@@ -380,6 +380,8 @@ class User:
await maybe_future(authenticator.pre_spawn_start(self, spawner))
spawner._start_pending = True
spawner.started = datetime.utcnow()
db.commit()
# wait for spawner.start to return
try:
# run optional preparation work to bootstrap the notebook
@@ -527,6 +529,8 @@ class User:
self.db.delete(orm_token)
self.db.commit()
finally:
spawner.started = None
self.db.commit()
# trigger post-spawner hook on authenticator
auth = spawner.authenticator
try: