* fix(connector): fixed bug of cache dict size error * fix(connector): Added method to save state in s3 for redshift if sigterm arise * fix(connector): Added exit signal handler and checkpoint method * Added sslmode selection for connection to database, added use_ssl parameter for S3 connection
14 lines
383 B
Python
14 lines
383 B
Python
import signal
|
|
|
|
class SignalHandler:
|
|
KEEP_PROCESSING = True
|
|
def __init__(self):
|
|
signal.signal(signal.SIGINT, self.exit_gracefully)
|
|
signal.signal(signal.SIGTERM, self.exit_gracefully)
|
|
|
|
def exit_gracefully(self, signum, frame):
|
|
print(f"Exiting gracefully with signal {signum}")
|
|
self.KEEP_PROCESSING = False
|
|
|
|
|
|
signal_handler = SignalHandler()
|