Skip to content

Commit f3d5eb8

Browse files
committed
refactor: await emit and flush
1 parent 36e2947 commit f3d5eb8

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

nbgitpuller/handlers.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ async def get(self):
4242
try:
4343
await self.git_lock.acquire(1)
4444
except gen.TimeoutError:
45-
self.emit({
45+
await self.emit({
4646
'phase': 'error',
4747
'message': 'Another git operations is currently running, try again in a few minutes'
4848
})
@@ -97,7 +97,7 @@ def pull():
9797
if progress is None:
9898
break
9999
if isinstance(progress, Exception):
100-
self.emit({
100+
await self.emit({
101101
'phase': 'error',
102102
'message': str(progress),
103103
'output': '\n'.join([
@@ -109,11 +109,11 @@ def pull():
109109
})
110110
return
111111

112-
self.emit({'output': progress, 'phase': 'syncing'})
112+
await self.emit({'output': progress, 'phase': 'syncing'})
113113

114-
self.emit({'phase': 'finished'})
114+
await self.emit({'phase': 'finished'})
115115
except Exception as e:
116-
self.emit({
116+
await self.emit({
117117
'phase': 'error',
118118
'message': str(e),
119119
'output': '\n'.join([
@@ -173,7 +173,7 @@ async def get(self):
173173
'status.html',
174174
repo=repo, branch=branch, path=path, depth=depth, targetpath=targetpath, version=__version__
175175
))
176-
self.flush()
176+
await self.flush()
177177

178178

179179
class LegacyGitSyncRedirectHandler(IPythonHandler):

0 commit comments

Comments
 (0)