forked from M-Labs/artiq
1
0
Fork 0

master: delete head repository checkout on exit

This commit is contained in:
Sebastien Bourdeauducq 2015-08-08 11:44:19 +08:00
parent 42010fcd4b
commit c80f0fa07a
2 changed files with 5 additions and 0 deletions

View File

@ -74,6 +74,7 @@ def main():
else:
repo_backend = FilesystemBackend(args.repository)
repository = Repository(repo_backend, log.log)
atexit.register(repository.close)
repository.scan_async()
worker_handlers = {

View File

@ -63,6 +63,10 @@ class Repository:
self._scanning = False
def close(self):
# The object cannot be used anymore after calling this method.
self.backend.release_rev(self.head_rev)
@asyncio.coroutine
def scan(self):
if self._scanning: