psr-factory 5.0.0b18__py3-none-win_amd64.whl → 5.0.0b20__py3-none-win_amd64.whl

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.
psr/execqueue/db.py CHANGED
@@ -158,7 +158,7 @@ def update_local_execution_status(session, execution_id: str, status: int):
158
158
  def update_cloud_execution_status(session, repository_id: int, status: int):
159
159
  cloud_execution = session.query(CloudExecution).filter(CloudExecution.repository_id == repository_id).first()
160
160
  if cloud_execution:
161
- if status not in CloudStatus:
161
+ if CloudStatus(status) not in CloudStatus:
162
162
  raise ValueError("Wrong status for update.")
163
163
  cloud_execution.status = status
164
164
  session.commit()
psr/execqueue/server.py CHANGED
@@ -309,7 +309,6 @@ def get_status(execution_id):
309
309
  if repository_id is None:
310
310
  return jsonify({'error': 'Execution ID not found in Cloud'}), 404
311
311
  status = db.get_cloud_execution_status(session, repository_id)
312
- print(status)
313
312
  if status == db.CloudStatus.ERROR.value:
314
313
  status_msg = 'Execution finished with errors. Only log files will be downloaded'
315
314
  elif status == db.CloudStatus.RUNNING.value:
@@ -322,6 +321,7 @@ def get_status(execution_id):
322
321
  status_msg = 'Execution finished with errors and log files are avaialble to download'
323
322
  else:
324
323
  status_msg = 'Unknown status'
324
+ print(f"Cloud execution status for {execution_id} ({repository_id}): {status_msg}")
325
325
  return jsonify({'status_id': status, 'status_msg': status_msg}), 200
326
326
  else:
327
327
  status = db.get_local_execution_status(session, execution_id)
psr/execqueue/watcher.py CHANGED
@@ -12,7 +12,7 @@ SERVER_URL = os.getenv("SERVER_URL", "http://127.0.0.1:5000")
12
12
  WATCH_DIR = os.getenv("WATCH_DIR")
13
13
  PROCESSED_DIR = os.getenv("PROCESSED_DIR")
14
14
  RESULTS_DIR = os.getenv("RESULTS_DIR", "results")
15
- SLEEP_SECONDS = int(os.getenv("WATCHER_SLEEP", "1"))
15
+ SLEEP_SECONDS = int(os.getenv("WATCHER_SLEEP", "30"))
16
16
  DB_PATH = os.getenv("WATCHER_DB_PATH", "watcher.sqlite")
17
17
 
18
18
 
@@ -66,8 +66,7 @@ def _process_zip_files():
66
66
 
67
67
  logging.info(f"zip file found: {zip_path}")
68
68
 
69
- #case_id = execqueue.upload_case_file(zip_path, SERVER_URL)
70
- case_id = 1
69
+ case_id = execqueue.upload_case_file(zip_path, SERVER_URL)
71
70
  if not case_id:
72
71
  logging.error(f"Failed uploading file {zip_path}")
73
72
  continue
@@ -98,7 +97,6 @@ def _check_and_download_results():
98
97
  continue
99
98
  if status_id == 5 or status_id == 6:
100
99
  files = execqueue.get_results(cloud_upload_id, SERVER_URL, cloud_execution=True)
101
- print("Files:", files)
102
100
  if files:
103
101
  base_filename = os.path.splitext(filename)[0]
104
102
  download_folder_name = f"{base_filename}-{cloud_upload_id}"
psr/factory/__init__.py CHANGED
@@ -2,6 +2,6 @@
2
2
  # Unauthorized copying of this file, via any medium is strictly prohibited
3
3
  # Proprietary and confidential
4
4
 
5
- __version__ = "5.0.0b18"
5
+ __version__ = "5.0.0b20"
6
6
 
7
7
  from .api import *