dbos 0.7.0a9__py3-none-any.whl → 0.7.1__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.
@@ -0,0 +1,34 @@
1
+ """fix_job_queue
2
+
3
+ Revision ID: 50f3227f0b4b
4
+ Revises: eab0cc1d9a14
5
+ Create Date: 2024-09-25 14:03:53.308068
6
+
7
+ """
8
+
9
+ from typing import Sequence, Union
10
+
11
+ from alembic import op
12
+
13
+ # revision identifiers, used by Alembic.
14
+ revision: str = "50f3227f0b4b"
15
+ down_revision: Union[str, None] = "eab0cc1d9a14"
16
+ branch_labels: Union[str, Sequence[str], None] = None
17
+ depends_on: Union[str, Sequence[str], None] = None
18
+
19
+
20
+ def upgrade() -> None:
21
+ op.drop_constraint("job_queue_pkey", "job_queue", schema="dbos", type_="primary")
22
+
23
+ op.create_primary_key(
24
+ "job_queue_pkey", "job_queue", ["workflow_uuid"], schema="dbos"
25
+ )
26
+
27
+
28
+ def downgrade() -> None:
29
+ # Reverting the changes
30
+ op.drop_constraint("job_queue_pkey", "job_queue", schema="dbos", type_="primary")
31
+
32
+ op.create_primary_key(
33
+ "job_queue_pkey", "job_queue", ["created_at_epoch_ms"], schema="dbos"
34
+ )
dbos/queue.py CHANGED
@@ -1,9 +1,9 @@
1
1
  import threading
2
2
  import time
3
+ import traceback
3
4
  from typing import TYPE_CHECKING, Optional
4
5
 
5
6
  from dbos.core import P, R, _execute_workflow_id, _start_workflow
6
- from dbos.error import DBOSInitializationError
7
7
 
8
8
  if TYPE_CHECKING:
9
9
  from dbos.dbos import DBOS, Workflow, WorkflowHandle
@@ -31,6 +31,13 @@ def queue_thread(stop_event: threading.Event, dbos: "DBOS") -> None:
31
31
  while not stop_event.is_set():
32
32
  time.sleep(1)
33
33
  for queue_name, queue in dbos._registry.queue_info_map.items():
34
- wf_ids = dbos._sys_db.start_queued_workflows(queue_name, queue.concurrency)
35
- for id in wf_ids:
36
- _execute_workflow_id(dbos, id)
34
+ try:
35
+ wf_ids = dbos._sys_db.start_queued_workflows(
36
+ queue_name, queue.concurrency
37
+ )
38
+ for id in wf_ids:
39
+ _execute_workflow_id(dbos, id)
40
+ except Exception:
41
+ dbos.logger.warning(
42
+ f"Exception encountered in queue thread: {traceback.format_exc()}"
43
+ )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dbos
3
- Version: 0.7.0a9
3
+ Version: 0.7.1
4
4
  Summary: Ultra-lightweight durable execution in Python
5
5
  Author-Email: "DBOS, Inc." <contact@dbos.dev>
6
6
  License: MIT
@@ -1,7 +1,7 @@
1
- dbos-0.7.0a9.dist-info/METADATA,sha256=-j59txtUuEZaesLoUp2rVA_29aKu8w-lkWcbM4KI1oY,5010
2
- dbos-0.7.0a9.dist-info/WHEEL,sha256=rSwsxJWe3vzyR5HCwjWXQruDgschpei4h_giTm0dJVE,90
3
- dbos-0.7.0a9.dist-info/entry_points.txt,sha256=3PmOPbM4FYxEmggRRdJw0oAsiBzKR8U0yx7bmwUmMOM,39
4
- dbos-0.7.0a9.dist-info/licenses/LICENSE,sha256=VGZit_a5-kdw9WT6fY5jxAWVwGQzgLFyPWrcVVUhVNU,1067
1
+ dbos-0.7.1.dist-info/METADATA,sha256=QHt_JDIOSevYneZp55Ub9nMvdDDZlf0eTVd5GY6DUEI,5008
2
+ dbos-0.7.1.dist-info/WHEEL,sha256=Vza3XR51HW1KmFP0iIMUVYIvz0uQuKJpIXKYOBGQyFQ,90
3
+ dbos-0.7.1.dist-info/entry_points.txt,sha256=z6GcVANQV7Uw_82H9Ob2axJX6V3imftyZsljdh-M1HU,54
4
+ dbos-0.7.1.dist-info/licenses/LICENSE,sha256=VGZit_a5-kdw9WT6fY5jxAWVwGQzgLFyPWrcVVUhVNU,1067
5
5
  dbos/__init__.py,sha256=jjlBFzSAzO2e-LD5IKJw7bRqZjrxpF5Sn-_JUJJptHU,680
6
6
  dbos/admin_sever.py,sha256=Qg5T3YRrbPW05PR_99yAaxgo1ugQrAp_uTeTqSfjm_k,3397
7
7
  dbos/application_database.py,sha256=knFK8We8y6WrIpnFCKvFq5hvSuFQqUuJqOqDpSVMCPI,5521
@@ -20,11 +20,12 @@ dbos/kafka_message.py,sha256=NYvOXNG3Qn7bghn1pv3fg4Pbs86ILZGcK4IB-MLUNu0,409
20
20
  dbos/logger.py,sha256=D-aFSZUCHBP34J1IZ5YNkTrJW-rDiH3py_v9jLU4Yrk,3565
21
21
  dbos/migrations/env.py,sha256=38SIGVbmn_VV2x2u1aHLcPOoWgZ84eCymf3g_NljmbU,1626
22
22
  dbos/migrations/script.py.mako,sha256=MEqL-2qATlST9TAOeYgscMn1uy6HUS9NFvDgl93dMj8,635
23
+ dbos/migrations/versions/50f3227f0b4b_fix_job_queue.py,sha256=ZtnsZFMuon-D0n8V5BR10jQEqJPUsYsOwt29FAoKG8g,868
23
24
  dbos/migrations/versions/5c361fc04708_added_system_tables.py,sha256=QMgFMb0aLgC25YicsvPSr6AHRCA6Zd66hyaRUhwKzrQ,6404
24
25
  dbos/migrations/versions/a3b18ad34abe_added_triggers.py,sha256=Rv0ZsZYZ_WdgGEULYsPfnp4YzaO5L198gDTgYY39AVA,2022
25
26
  dbos/migrations/versions/eab0cc1d9a14_job_queue.py,sha256=_9-FCW-zOpCQfblTS_yRLtFiUaWlC1tM4BoKBTDeH9k,1395
26
27
  dbos/py.typed,sha256=QfzXT1Ktfk3Rj84akygc7_42z0lRpCq0Ilh8OXI6Zas,44
27
- dbos/queue.py,sha256=5unMPX1ThoVWfXOR2IUSeIjgATgcX_YmZS3Fz1Uoc7o,1228
28
+ dbos/queue.py,sha256=ngY1MN3xD7jAvEXlrl_D16FUPpP_vpRgbyERLfPyU9Y,1437
28
29
  dbos/recovery.py,sha256=zqtO_ExGoIErLMVnbneU3VeHLVWvhV4jnfqssAVlQQk,2016
29
30
  dbos/registrations.py,sha256=gMI-u05tv5bpvyddQGtoUgCsqARx51aOY7p0JXPafQo,6539
30
31
  dbos/request.py,sha256=-FIwtknayvRl6OjvqO4V2GySVzSdP1Ft3cc9ZBS-PLY,928
@@ -48,4 +49,4 @@ dbos/templates/hello/start_postgres_docker.py,sha256=lQVLlYO5YkhGPEgPqwGc7Y8uDKs
48
49
  dbos/tracer.py,sha256=GaXDhdKKF_IQp5SAMipGXiDVwteRKjNbrXyYCH1mor0,2520
49
50
  dbos/utils.py,sha256=hWj9iWDrby2cVEhb0pG-IdnrxLqP64NhkaWUXiLc8bA,402
50
51
  version/__init__.py,sha256=L4sNxecRuqdtSFdpUGX3TtBi9KL3k7YsZVIvv-fv9-A,1678
51
- dbos-0.7.0a9.dist-info/RECORD,,
52
+ dbos-0.7.1.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: pdm-backend (2.3.3)
2
+ Generator: pdm-backend (2.4.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -1,3 +1,5 @@
1
1
  [console_scripts]
2
2
  dbos = dbos.cli:app
3
3
 
4
+ [gui_scripts]
5
+