She type on my safety till i stop concatenating on her string

This commit is contained in:
Iris De Santis 2024-08-05 14:58:38 +02:00
parent f482845365
commit 5c2f8c9299
No known key found for this signature in database
GPG key ID: 3FB89E8ADB3D4BFC
4 changed files with 8 additions and 4 deletions

View file

@ -7,5 +7,6 @@
"**/.DS_Store": true,
"**/Thumbs.db": true
},
"hide-files.files": []
"hide-files.files": [],
"python.analysis.typeCheckingMode": "basic"
}

View file

@ -7,4 +7,5 @@ def check_boot_errors():
result = subprocess.run(["dmesg"], capture_output=True, text=True)
errors = result.stdout.lower().count("error")
if errors > 30:
log_message("Last boot has had more than 30 errors,, :c (according to dmesg)" + environ.get("BOT_OWNER") + " please check the logs!")
bot_owner = environ.get("BOT_OWNER", "Unknown")
log_message(f"Last boot has had more than 30 errors,, :c (according to dmesg) {bot_owner} please check the logs!")

View file

@ -14,7 +14,8 @@ def check_cpu_usage():
cpu_overload_start = datetime.now()
elif (datetime.now() - cpu_overload_start).total_seconds() > 120:
process_info = get_top_cpu_process()
log_message(f"CPU overloaded by {process_info} for more than 2 minutes,," + environ.get("BOT_OWNER") + " please do something!")
bot_owner = environ.get("BOT_OWNER", "Unknown")
log_message(f"CPU overloaded by {process_info} for more than 2 minutes,, {bot_owner} please do something!")
cpu_overload_start = None # Reset
else:
cpu_overload_start = None # Reset if not overloaded

View file

@ -25,7 +25,8 @@ def main():
post_to_misskey("Performed system health check.")
time.sleep(300) # Wait for 5 minutes before next check
except KeyboardInterrupt:
log_message("Monitoring stopped by " + environ.get("BOT_OWNER") + " ,,")
bot_owner = environ.get("BOT_OWNER", "Unknown")
log_message(f"Monitoring stopped by {bot_owner} ,,")
if __name__ == "__main__":
main()