@@ -251,7 +251,7 @@ def _run_script():
251
251
script .log_info ("Database changes have been reverted automatically." )
252
252
clear_webhooks .send (request )
253
253
254
- script_execution .data ["output" ] = output
254
+ script_execution .data ["output" ] = str ( output )
255
255
script_execution .terminate ()
256
256
except Exception as e :
257
257
if type (e ) is AbortScript :
@@ -263,7 +263,7 @@ def _run_script():
263
263
logger .error (f"Exception raised during script execution: { e } " )
264
264
script .log_info ("Database changes have been reverted due to error." )
265
265
266
- script_execution .data ["output" ] = output
266
+ script_execution .data ["output" ] = str ( output )
267
267
268
268
script_execution .terminate (status = ScriptExecutionStatusChoices .STATUS_ERRORED )
269
269
clear_webhooks .send (request )
@@ -287,6 +287,12 @@ def _run_script():
287
287
new_request_id = uuid .uuid4 ()
288
288
request .id = new_request_id
289
289
290
+ # Maintain the input but clear the output
291
+ new_data = {
292
+ "input" : script_execution .data .get ("input" ),
293
+ "output" : None ,
294
+ }
295
+
290
296
next_execution = ScriptExecution (
291
297
script_instance = script_execution .script_instance ,
292
298
task_id = uuid .uuid4 (),
@@ -296,6 +302,7 @@ def _run_script():
296
302
scheduled = new_scheduled_time ,
297
303
interval = script_execution .interval ,
298
304
task_queue = script_execution .task_queue ,
305
+ data = new_data ,
299
306
)
300
307
next_execution .full_clean ()
301
308
next_execution .save ()
0 commit comments