Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
deexno authored Aug 9, 2023
1 parent 89070d2 commit f9e6ab4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 6 additions & 4 deletions resources/fqueue.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ def store_queue(self):
with open(self.file_path, "w", encoding="utf-8") as f:
for item in self.queue:
f.write(
f"{item['event']}|"
f"{item['id']}|"
f"{item['priority']}|"
f"{item['event']};;"
f"{item['id']};;"
f"{item['priority']};;"
f"{item['created']}\n"
)

Expand All @@ -29,7 +29,9 @@ def update_queue(self):
self.queue = []
with open(self.file_path, "r", encoding="utf-8") as f:
for line in f:
event, item_id, priority, created = line.strip().split("|")
event, item_id, priority, created = line.strip().split(
";;"
)
self.queue.append(
{
"event": event,
Expand Down
4 changes: 2 additions & 2 deletions resources/telegram_plus_notify_listener
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ mkdir -p $destination_log_folder # Creates the directory if it doesn't already e

# Save all variables in a file which is then read and processed by the Telegram bot.
if [[ ${NOTIFY_WHAT} == "SERVICE" ]]; then
echo "$notify;${NOTIFY_SERVICEDESC};${NOTIFY_PREVIOUSSERVICEHARDSHORTSTATE};${NOTIFY_SERVICESHORTSTATE};${NOTIFY_SERVICEOUTPUT}|${random_line_identifier}|0|${now}" >> $destination_log_file_path
echo "$notify;${NOTIFY_SERVICEDESC};${NOTIFY_PREVIOUSSERVICEHARDSHORTSTATE};${NOTIFY_SERVICESHORTSTATE};${NOTIFY_SERVICEOUTPUT};;${random_line_identifier};;0;;${now}" >> $destination_log_file_path
else
echo "$notify;HOST STATUS;${NOTIFY_PREVIOUSHOSTHARDSHORTSTATE};${NOTIFY_HOSTSHORTSTATE};${NOTIFY_HOSTOUTPUT}|${random_line_identifier}|0|${now}" >> $destination_log_file_path
echo "$notify;HOST STATUS;${NOTIFY_PREVIOUSHOSTHARDSHORTSTATE};${NOTIFY_HOSTSHORTSTATE};${NOTIFY_HOSTOUTPUT};;${random_line_identifier};;0;;${now}" >> $destination_log_file_path
fi

echo "NOTIFY WAS SEND TO TELEGRAM PLUS"

0 comments on commit f9e6ab4

Please sign in to comment.