mirror of
https://git.proxmox.com/git/mirror_linux-firmware
synced 2025-07-26 04:59:28 +00:00
Merge branch 'superm1/server-issues' into 'main'
trivial: contrib: wrap the process in try/except to catch server issues See merge request kernel-firmware/linux-firmware!423
This commit is contained in:
commit
fc3f0a5bc6
@ -376,19 +376,23 @@ if __name__ == "__main__":
|
|||||||
logging.getLogger("").addHandler(console)
|
logging.getLogger("").addHandler(console)
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
conn = sqlite3.connect(args.database)
|
|
||||||
# update the database
|
|
||||||
update_database(conn, args.url)
|
|
||||||
|
|
||||||
if args.dry:
|
if args.dry:
|
||||||
remote = ""
|
remote = ""
|
||||||
else:
|
else:
|
||||||
remote = args.remote
|
remote = args.remote
|
||||||
|
|
||||||
# process the database
|
try:
|
||||||
process_database(conn, remote)
|
conn = sqlite3.connect(args.database)
|
||||||
|
|
||||||
conn.close()
|
# update the database
|
||||||
|
update_database(conn, args.url)
|
||||||
|
# process the database
|
||||||
|
process_database(conn, remote)
|
||||||
|
|
||||||
|
except urllib.error.HTTPError as e:
|
||||||
|
logging.error("Failed to fetch URL: {}".format(e))
|
||||||
|
finally:
|
||||||
|
conn.close()
|
||||||
|
|
||||||
if args.refresh_cycle:
|
if args.refresh_cycle:
|
||||||
logging.info("Sleeping for {} minutes".format(args.refresh_cycle))
|
logging.info("Sleeping for {} minutes".format(args.refresh_cycle))
|
||||||
|
Loading…
Reference in New Issue
Block a user