forked from M-Labs/artiq
master: delete head repository checkout on exit
This commit is contained in:
parent
42010fcd4b
commit
c80f0fa07a
|
@ -74,6 +74,7 @@ def main():
|
||||||
else:
|
else:
|
||||||
repo_backend = FilesystemBackend(args.repository)
|
repo_backend = FilesystemBackend(args.repository)
|
||||||
repository = Repository(repo_backend, log.log)
|
repository = Repository(repo_backend, log.log)
|
||||||
|
atexit.register(repository.close)
|
||||||
repository.scan_async()
|
repository.scan_async()
|
||||||
|
|
||||||
worker_handlers = {
|
worker_handlers = {
|
||||||
|
|
|
@ -63,6 +63,10 @@ class Repository:
|
||||||
|
|
||||||
self._scanning = False
|
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
|
@asyncio.coroutine
|
||||||
def scan(self):
|
def scan(self):
|
||||||
if self._scanning:
|
if self._scanning:
|
||||||
|
|
Loading…
Reference in New Issue