diff --git a/invites-manager/invites-routine.py b/invites-manager/invites-routine.py index fb9dd36..867fa98 100644 --- a/invites-manager/invites-routine.py +++ b/invites-manager/invites-routine.py @@ -5,10 +5,7 @@ import mysql.connector as mysql from os import getenv import time, sys -code_name = 'INVITES_MANAGER' - def remove_old(config): - global code_name ''' Removes invites that are out of date ''' @@ -22,11 +19,10 @@ def remove_old(config): cursor.close() conn.close() - print(f'[ {code_name} ] : Removed old invites with no errors') + print(f'[ {__file__} ] : Removed old invites with no errors') if __name__ == '__main__': - fail = False config = { 'database': getenv('DATABASE_NAME'), 'password': getenv('DATABASE_PASS'), @@ -36,11 +32,7 @@ if __name__ == '__main__': } for k in config: if config[k] is None: - print(f'[ {code_name} ] : {k} not set', file=sys.stderr) - fail = True - - - if not fail: - remove_old(config) + print(f'[ {__file__} ] : {k} not set', file=sys.stderr) else: - exit(1) + remove_old(config) +