From d5cf4f53afaeedb36cdd714aae5a6b5a161e1367 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Sep 03 2019 14:48:10 +0000 Subject: Fix the logic around interacting with read-only databases in hooks GIT_HOOK_DB_RO is set to True when the git hooks have a read-only access to the database. When they have a read-only access to the database, they can't edit it and thus need to send instructions interacting with it to a worker who can do the edit asynchronously. Turns out we had the logic exactly opposite as to what it should be. This commit fixes that. Now how did we get away with this for so long is a mystery. Signed-off-by: Pierre-Yves Chibon --- diff --git a/pagure/hooks/default.py b/pagure/hooks/default.py index 6b1b99e..bc1a8df 100644 --- a/pagure/hooks/default.py +++ b/pagure/hooks/default.py @@ -413,7 +413,7 @@ class DefaultRunner(BaseRunner): # Refresh of all opened PRs parent = project.parent or project - if _config.get("GIT_HOOK_DB_RO", False): + if not _config.get("GIT_HOOK_DB_RO", False): pagure.lib.tasks.refresh_pr_cache( parent.name, parent.namespace,