summaryrefslogtreecommitdiff
path: root/apps/patchwork/bin/update-committed-patches.py
diff options
context:
space:
mode:
Diffstat (limited to 'apps/patchwork/bin/update-committed-patches.py')
-rwxr-xr-xapps/patchwork/bin/update-committed-patches.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/apps/patchwork/bin/update-committed-patches.py b/apps/patchwork/bin/update-committed-patches.py
index 86afa4d..c10aad3 100755
--- a/apps/patchwork/bin/update-committed-patches.py
+++ b/apps/patchwork/bin/update-committed-patches.py
@@ -9,8 +9,6 @@
# accepted into sub-maintainer/custodian branches will only be marked as
# accepted once they reach the master branch.
-import _pythonpath
-import atexit
import sys
from datetime import datetime
@@ -49,11 +47,14 @@ def main():
sys.exit(1)
cache_db = PatchworkDB(settings.CROWD_USERS_DB_FILE)
- atexit.register(cache_db.close)
-
projects = Project.objects.exclude(
Q(source_tree__isnull=True) | Q(source_tree=''))
+ with cache_db:
+ _update(crwd, projects, cache_db)
+
+
+def _update(crwd, projects, cache_db):
print "Total number of projects: {0}".format(len(projects))
for project in projects: