Get gitea rocket webhook parameters correct
This commit is contained in:
@@ -172,6 +172,7 @@ def send_to_rocket_chat(alias: str, text: str, attachments: Optional[List[Dict[s
|
|||||||
logging.exception("%s: failed to send to Rocket.Chat: %s", alias, e)
|
logging.exception("%s: failed to send to Rocket.Chat: %s", alias, e)
|
||||||
|
|
||||||
def send_startup_message(feed_name: str, chat_url: str):
|
def send_startup_message(feed_name: str, chat_url: str):
|
||||||
|
logging.info(f"Sent startup message to {feed_name}")
|
||||||
send_to_rocket_chat(feed_name.capitalize(), f"{feed_name.capitalize()} integration started successfully.", None, chat_url)
|
send_to_rocket_chat(feed_name.capitalize(), f"{feed_name.capitalize()} integration started successfully.", None, chat_url)
|
||||||
|
|
||||||
# ---------------------------
|
# ---------------------------
|
||||||
@@ -1184,20 +1185,20 @@ def main():
|
|||||||
selected = {f.strip() for f in args.feeds.split(",") if f.strip()} if args.feeds else set()
|
selected = {f.strip() for f in args.feeds.split(",") if f.strip()} if args.feeds else set()
|
||||||
domain_cache = {}
|
domain_cache = {}
|
||||||
|
|
||||||
sent_types = set()
|
sent_types = set()
|
||||||
|
|
||||||
for name, conf in FEED_CONFIG.items():
|
for name, conf in FEED_CONFIG.items():
|
||||||
if not conf.get("enabled"):
|
if not conf.get("enabled"):
|
||||||
continue
|
continue
|
||||||
if selected and name not in selected:
|
if selected and name not in selected:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
feed_type = conf.get("type")
|
feed_type = conf.get("type")
|
||||||
if feed_type in sent_types:
|
if feed_type in sent_types:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
send_startup_message(feed_type, conf.get("chat_url"))
|
send_startup_message(feed_type, conf.get("chat_url"))
|
||||||
sent_types.add(feed_type)
|
sent_types.add(feed_type)
|
||||||
|
|
||||||
processors = {"bugzilla": process_bugzilla, "koji": process_koji, "wiki": process_wiki, "gitea": process_gitea}
|
processors = {"bugzilla": process_bugzilla, "koji": process_koji, "wiki": process_wiki, "gitea": process_gitea}
|
||||||
sleep_sec = max(1, args.sleep) * 60
|
sleep_sec = max(1, args.sleep) * 60
|
||||||
|
|||||||
Reference in New Issue
Block a user