Files
nvidia-stock-bot/app/main.py
T
Djeex 5a7a60d299
CI / build-and-scan (push) Successful in 1m37s
CI/CD hardening: lint, secret scan, coverage gate, auto CVE-fix PRs, GHCR + GitHub mirror publishing (#32)
- release changelog: commits rendered as description (link), divider lines dropped
- gitleaks secret scan and hadolint on every push/PR
- ruff lint/format gate (Python repos) with a pytest --cov-fail-under gate
- scheduled CRITICAL Trivy failures attempt an apk upgrade rebuild and open a follow-up PR if it clears the finding, instead of just failing red
- images also published to ghcr.io/djeex/<repo>
- a matching GitHub Release is created on the GitHub mirror, with a notice pointing back to this repo as the source of truth
2026-08-26 15:43:40 +02:00

30 lines
804 B
Python

import logging
import signal
import sys
import time
from env_config import REFRESH_TIME
from gpu_checker import check_rtx_50_founders
# Signal handler function
def handle_exit(signum, frame):
logging.info(f"🛑 Received signal {signum}. Exiting gracefully...")
sys.exit(0)
# Register signal handlers
signal.signal(signal.SIGINT, handle_exit) # Ctrl+C
signal.signal(signal.SIGTERM, handle_exit) # docker stop / kill -15
if __name__ == "__main__":
try:
while True:
start = time.time()
check_rtx_50_founders()
elapsed = time.time() - start
time.sleep(max(0, REFRESH_TIME - elapsed))
except KeyboardInterrupt:
logging.info("🛑 Script interrupted by user (KeyboardInterrupt). Exiting gracefully.")
sys.exit(0)