closes #1958220: we have to watch ourselves for repo shutdown

authorSylvain Thénault <sylvain.thenault@logilab.fr>
changeset059bc3a9d30f
branchstable
phasepublic
hiddenno
parent revision#831a676d1336 closes #1777404: improve VersionedFile dc_long_title msgid
child revision#0df9b4b40201 closes #1958218: don't log traceback on bad url/access denied
files modified by this revision
hooks.py
# HG changeset patch
# User Sylvain Thénault <sylvain.thenault@logilab.fr>
# Date 1317050122 -7200
# Mon Sep 26 17:15:22 2011 +0200
# Branch stable
# Node ID 059bc3a9d30f260a0c3619e3964f0e9dba24c998
# Parent 831a676d13365c3f8d234bcfb0278db6f0ad17df
closes #1958220: we have to watch ourselves for repo shutdown

diff --git a/hooks.py b/hooks.py
@@ -121,10 +121,17 @@
1                      'Any R, RT, RE, RLC, RSU, RP, RIRC WHERE R is Repository, '
2                      'NOT (R local_cache NULL AND R path NULL),'
3                      'R type RT, R encoding RE, R local_cache RLC, R source_url RSU, R path RP,'
4                      'R import_revision_content RIRC, R cw_source S, S name "system"')
5                  for vcsrepo in reposrset.entities():
6 +                    # watch for repository being shut-down, our thread may:
7 +                    # * not receive the KeyboardInterrupt or shutdown signal
8 +                    # * loop a while without accessing the session (actually
9 +                    #   until some repository is actually not up-to-date, while
10 +                    #   this access to the session would abort the task)
11 +                    if repo.shutting_down:
12 +                        break
13                      try:
14                          repohdlr = bridge.repository_handler(vcsrepo)
15                      except bridge.VCSException, ex:
16                          repo.error(str(ex))
17                          continue