From d4adcb3c22df262bde9377328783e37e71d8f81e Mon Sep 17 00:00:00 2001 From: salberts Date: Sat, 8 Jul 2023 10:26:41 +0300 Subject: [PATCH] Configurable polling interval --- pr_agent/servers/gitlab_polling.py | 2 +- pr_agent/settings/configuration.toml | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pr_agent/servers/gitlab_polling.py b/pr_agent/servers/gitlab_polling.py index d86a7fe2..529fae14 100644 --- a/pr_agent/servers/gitlab_polling.py +++ b/pr_agent/servers/gitlab_polling.py @@ -57,7 +57,7 @@ def run(): # Run the check every minute while True: - # time.sleep(60) + time.sleep(settings.get("GITLAB.POLLING_INTERVAL_SECONDS")) new_comments = check_comments() if new_comments: handle_new_comments(new_comments) diff --git a/pr_agent/settings/configuration.toml b/pr_agent/settings/configuration.toml index 086b96bb..230b86e0 100644 --- a/pr_agent/settings/configuration.toml +++ b/pr_agent/settings/configuration.toml @@ -22,4 +22,7 @@ gitlab_url = "https://gitlab.com" projects_to_monitor = [47494341] # Polling trigger -magic_word = "MagicRound" \ No newline at end of file +magic_word = "MagicRound" + +# Polling interval +polling_interval_seconds = 60 \ No newline at end of file