brynq-sdk-task-scheduler 4.0.6__tar.gz → 4.0.7__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 1.0
2
2
  Name: brynq_sdk_task_scheduler
3
- Version: 4.0.6
3
+ Version: 4.0.7
4
4
  Summary: Code to execute tasks in BrynQ.com with the task scheduler
5
5
  Home-page: UNKNOWN
6
6
  Author: BrynQ
@@ -254,8 +254,12 @@ class TaskScheduler:
254
254
  filter=f'WHERE `reload_id` = {self.run_id}')
255
255
  if self.email_after_errors:
256
256
  self.email_errors(failed=True)
257
- # Remove the temp values from the variables table
258
- self.mysql.raw_query(f'UPDATE `task_variables` SET temp_value = null WHERE task_id = {self.task_id}', insert=True)
257
+
258
+ # Remove the temp values from the variables table (legacy), if it doesn't exist, ignore the error. In that case it will already be flushed by the API endpoint
259
+ try:
260
+ self.mysql.raw_query(f'UPDATE `task_variables` SET temp_value = null WHERE task_id = {self.task_id}', insert=True)
261
+ except Exception as e:
262
+ pass
259
263
 
260
264
  # Start the chained tasks if it there are tasks which should start if this one is failed
261
265
  self.start_chained_tasks(finished_task_status='FAILED')
@@ -308,8 +312,11 @@ class TaskScheduler:
308
312
  values=['FinishedSuccess', f'{datetime.datetime.now()}'],
309
313
  filter=f'WHERE `reload_id` = {self.run_id}')
310
314
 
311
- # Remove the temp values from the variables table
312
- self.mysql.raw_query(f'UPDATE `task_variables` SET temp_value = null WHERE task_id = {self.task_id}', insert=True)
315
+ # Remove the temp values from the variables table if it exists (legacy)
316
+ try:
317
+ self.mysql.raw_query(f'UPDATE `task_variables` SET temp_value = null WHERE task_id = {self.task_id}', insert=True)
318
+ except Exception as e:
319
+ pass
313
320
 
314
321
  # Start the new task if it there is a task which should start if this one is finished
315
322
  self.start_chained_tasks(finished_task_status='SUCCESS')
@@ -381,7 +388,7 @@ class TaskScheduler:
381
388
  logs = []
382
389
  logs.append(payload)
383
390
  with open(log_file_path, 'w') as f:
384
- json.dump(logs, f)
391
+ json.dump(logs, f, default=str)
385
392
  except Exception as e:
386
393
  print(f"Error saving log locally: {e}")
387
394
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 1.0
2
2
  Name: brynq-sdk-task-scheduler
3
- Version: 4.0.6
3
+ Version: 4.0.7
4
4
  Summary: Code to execute tasks in BrynQ.com with the task scheduler
5
5
  Home-page: UNKNOWN
6
6
  Author: BrynQ
@@ -2,7 +2,7 @@ from setuptools import setup, find_namespace_packages
2
2
 
3
3
  setup(
4
4
  name='brynq_sdk_task_scheduler',
5
- version='4.0.6',
5
+ version='4.0.7',
6
6
  description='Code to execute tasks in BrynQ.com with the task scheduler',
7
7
  long_description='Code to execute tasks in the BrynQ.com platform with the task scheduler',
8
8
  author='BrynQ',