You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
logger.error("RETURN CODE OF DUMP PROCESS != 0. CHECK OUTPUT ABOVE FOR ERRORS!")
141
+
send_slack_message(environment, "Failed to create DB dump. Please check the error in the container logs.", False)
98
142
else:
143
+
file_size=0
144
+
145
+
try:
146
+
file_size=os.path.getsize(dump_path) /1024
147
+
exceptExceptionase:
148
+
logger.error("Failed to get size of file.")
149
+
logger.exception(e)
150
+
99
151
logger.info(f'{datetime.now()}: Backup created. Uploading to glacier')
100
152
try:
101
153
glacier=boto3.client('glacier')
@@ -107,8 +159,10 @@ def dump_database():
107
159
body=f,
108
160
))
109
161
logger.info('Glacier upload done.')
162
+
send_slack_message(environment, f"Successfully created and uploaded DB dump ({round(file_size, 2)} KB).")
110
163
exceptExceptionase:
111
164
logger.exception(e)
165
+
send_slack_message(environment, f"Failed to upload DB dump ({round(file_size, 2)} KB) to AWS Glacier. Please check the error in the container logs.", False)
112
166
else:
113
167
logger.error(f'Database of type {database_type} is not supported. If you see this message something went horribly wrong.')
0 commit comments