primitive 0.2.28__py3-none-any.whl → 0.2.29__py3-none-any.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.
primitive/__about__.py CHANGED
@@ -1,4 +1,4 @@
1
1
  # SPDX-FileCopyrightText: 2024-present Dylan Stein <dylan@primitive.tech>
2
2
  #
3
3
  # SPDX-License-Identifier: MIT
4
- __version__ = "0.2.28"
4
+ __version__ = "0.2.29"
@@ -61,6 +61,22 @@ class Monitor(BaseAction):
61
61
  # FIRST, check for jobs in the database that are running
62
62
  db_job_runs = JobRun.objects.all()
63
63
  for job_run in db_job_runs:
64
+ # first check if the job run completed already
65
+ status = self.primitive.jobs.get_job_status(job_run.job_run_id)
66
+ if status is None or status.data is None:
67
+ logger.error(
68
+ f"Error fetching status of <JobRun {job_run.job_run_id}>."
69
+ )
70
+ continue
71
+
72
+ status_value = status.data["jobRun"]["status"]
73
+ if status_value == "completed":
74
+ logger.debug(
75
+ f"Job run {job_run.job_run_id} is completed. Removing from database."
76
+ )
77
+ JobRun.objects.filter_by(job_run_id=job_run.job_run_id).delete()
78
+ continue
79
+
64
80
  if job_run.pid is None:
65
81
  pid_sleep_amount = 0.1
66
82
  logger.debug(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: primitive
3
- Version: 0.2.28
3
+ Version: 0.2.29
4
4
  Project-URL: Documentation, https://github.com//primitivecorp/primitive-cli#readme
5
5
  Project-URL: Issues, https://github.com//primitivecorp/primitive-cli/issues
6
6
  Project-URL: Source, https://github.com//primitivecorp/primitive-cli
@@ -1,4 +1,4 @@
1
- primitive/__about__.py,sha256=TN5q_6fZsIHlzQAAdwHQoUozl_mXtvh_nCPeIoE5zEQ,130
1
+ primitive/__about__.py,sha256=HaB4AohTz2I2snoLFoXHdHwP9yvCohtADZo1dibKpG4,130
2
2
  primitive/__init__.py,sha256=bwKdgggKNVssJFVPfKSxqFMz4IxSr54WWbmiZqTMPNI,106
3
3
  primitive/cli.py,sha256=g7EtHI9MATAB0qQu5w-WzbXtxz_8zu8z5E7sETmMkKU,2509
4
4
  primitive/client.py,sha256=h8WZVnQylVe0vbpuyC8YZHl2JyITSPC-1HbUcmrE5pc,3623
@@ -57,7 +57,7 @@ primitive/jobs/graphql/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3
57
57
  primitive/jobs/graphql/fragments.py,sha256=1_ZttT7dx36KDC3DClJz9M8LMpsPwXySBygHSiUEcGg,619
58
58
  primitive/jobs/graphql/mutations.py,sha256=8ASvCmwQh7cMeeiykOdYaYVryG8FRIuVF6v_J8JJZuw,219
59
59
  primitive/jobs/graphql/queries.py,sha256=BrU_GnLjK0bTAmWsLSmGEUea7EM8MqTKxN1Qp6sSjwc,1597
60
- primitive/monitor/actions.py,sha256=cFCsQZvTwkmcWGPwNgop4fKQX4VWLRKJz_2c7_s9bII,10054
60
+ primitive/monitor/actions.py,sha256=tAeMMOzqdUl6_m6BW_YWEd72Tl9NnfTLPCZyOFR2GUs,10856
61
61
  primitive/monitor/commands.py,sha256=VDlEL_Qpm_ysHxug7VpI0cVAZ0ny6AS91Y58D7F1zkU,409
62
62
  primitive/organizations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
63
63
  primitive/organizations/actions.py,sha256=kVHOhG1oS2sI5p8uldSo5L-RUZsnG36eaulVuKLyZ-M,1863
@@ -96,8 +96,8 @@ primitive/utils/memory_size.py,sha256=4xfha21kW82nFvOTtDFx9Jk2ZQoEhkfXii-PGNTpIU
96
96
  primitive/utils/printer.py,sha256=f1XUpqi5dkTL3GWvYRUGlSwtj2IxU1q745T4Fxo7Tn4,370
97
97
  primitive/utils/shell.py,sha256=jWzb7ky7p987dJas6ZvarK3IJNZ5cwBXcryRWb9Uh6U,2072
98
98
  primitive/utils/text.py,sha256=XiESMnlhjQ534xE2hMNf08WehE1SKaYFRNih0MmnK0k,829
99
- primitive-0.2.28.dist-info/METADATA,sha256=SWVPvj72QFr4vA9JmhfeCRP593o1L1t_I8RxwPsqXhw,3569
100
- primitive-0.2.28.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
101
- primitive-0.2.28.dist-info/entry_points.txt,sha256=p1K8DMCWka5FqLlqP1sPek5Uovy9jq8u51gUsP-z334,48
102
- primitive-0.2.28.dist-info/licenses/LICENSE.txt,sha256=B8kmQMJ2sxYygjCLBk770uacaMci4mPSoJJ8WoDBY_c,1098
103
- primitive-0.2.28.dist-info/RECORD,,
99
+ primitive-0.2.29.dist-info/METADATA,sha256=0bHCQZiRhrgQn7R-xu4zx5Es_7B6wjSCugoAOynW1pI,3569
100
+ primitive-0.2.29.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
101
+ primitive-0.2.29.dist-info/entry_points.txt,sha256=p1K8DMCWka5FqLlqP1sPek5Uovy9jq8u51gUsP-z334,48
102
+ primitive-0.2.29.dist-info/licenses/LICENSE.txt,sha256=B8kmQMJ2sxYygjCLBk770uacaMci4mPSoJJ8WoDBY_c,1098
103
+ primitive-0.2.29.dist-info/RECORD,,