Moved network error sleeps to bash wrapper script

This commit is contained in:
Muaz Ahmad 2023-09-05 13:37:11 +05:00
parent c546999220
commit 9a253f5d14
2 changed files with 2 additions and 3 deletions

View file

@ -22,6 +22,8 @@ ddns_update() {
exit 1 exit 1
;; ;;
"2") "2")
echo "Retry in 5 min"
sleep 300
echo "Retrying" echo "Retrying"
;; ;;
"0") "0")

View file

@ -4,7 +4,6 @@ import os, json, sys, ipaddress, time, re
import requests import requests
API_SLEEP = 3 API_SLEEP = 3
NET_ERR_SLEEP = 300
class PorkbunClient(): class PorkbunClient():
def __init__(self): def __init__(self):
@ -49,7 +48,6 @@ class PorkbunClient():
sys.exit(1) sys.exit(1)
except: except:
print('Network error') print('Network error')
time.sleep(NET_ERR_SLEEP)
sys.exit(2) sys.exit(2)
def update_dns_record(self, content, record_type="A"): def update_dns_record(self, content, record_type="A"):
@ -77,7 +75,6 @@ class PorkbunClient():
except: except:
print("Network error") print("Network error")
time.sleep(NET_ERR_SLEEP)
sys.exit(2) sys.exit(2)