[buildinfo.debian.net] 07/08: Refresh all keys from the keyserver every day.

Chris Lamb chris at chris-lamb.co.uk
Fri Nov 4 11:08:09 UTC 2016


This is an automated email from the git hooks/post-receive script.

lamby pushed a commit to branch master
in repository buildinfo.debian.net.

commit 5853aa795fb29e33d522ed3404717391ac02eed1
Author: Chris Lamb <lamby at debian.org>
Date:   Fri Nov 4 11:07:29 2016 +0000

    Refresh all keys from the keyserver every day.
    
    Signed-off-by: Chris Lamb <lamby at debian.org>
---
 bidb/keys/tasks.py                 | 5 +++++
 bidb/settings/defaults/__init__.py | 4 ++++
 2 files changed, 9 insertions(+)

diff --git a/bidb/keys/tasks.py b/bidb/keys/tasks.py
index 5c49fd9..6c2487c 100644
--- a/bidb/keys/tasks.py
+++ b/bidb/keys/tasks.py
@@ -40,3 +40,8 @@ def update_or_create_key(uid):
     return Key.objects.update_or_create(uid=uid, defaults={
         'name': name,
     })
+
+ at celery.task()
+def refresh_all(uid):
+    for x in Key.objects.all():
+        update_or_create_key.delay(x.uid)
diff --git a/bidb/settings/defaults/__init__.py b/bidb/settings/defaults/__init__.py
index bf16800..2d0b48c 100644
--- a/bidb/settings/defaults/__init__.py
+++ b/bidb/settings/defaults/__init__.py
@@ -98,6 +98,10 @@ DEFAULT_FILE_STORAGE = 'django.core.files.storage.FileSystemStorage'
 BROKER_URL = 'redis://localhost:6379/0'
 
 CELERYBEAT_SCHEDULE = {
+    'keys_refresh_all': {
+        'task': 'bidb.keys.tasks.refresh_all',
+        'schedule': crontab(hour=0, minute=0),
+    },
 }
 
 EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/buildinfo.debian.net.git



More information about the Reproducible-commits mailing list