lightning-pose-app 1.8.1a5__py3-none-any.whl → 1.8.1a6__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: lightning-pose-app
3
- Version: 1.8.1a5
3
+ Version: 1.8.1a6
4
4
  Summary:
5
5
  Requires-Python: >=3.10
6
6
  Classifier: Programming Language :: Python :: 3
@@ -21,9 +21,9 @@ litpose_app/routes/files.py,sha256=HHyug226s_M4jMi8q7oI2dTWHTKu_J_c7vIbG0rdk9s,3
21
21
  litpose_app/routes/project.py,sha256=pQW7zFdGHMy_eE0Z1bIXs9QLkV1-_MwFHsZR51-H6uQ,1957
22
22
  litpose_app/routes/transcode.py,sha256=0p2GmQntbSDlBxhXiH9AeDXs44uRxfa1eiVNqt0LjUk,4848
23
23
  litpose_app/tasks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
24
- litpose_app/tasks/management.py,sha256=jAit5aa8Jckj_3qbaRH_1Voe1aLkxebpU2ulG87U7wI,600
24
+ litpose_app/tasks/management.py,sha256=Z_XYJsy4Mlz_0tQwITsnkPk-ugkMFa4ek6NcFrhTH74,831
25
25
  litpose_app/tasks/transcode_fine.py,sha256=bX8OblwMO_xaXXqZXJmmQPprCYIpPGHiboyEJli6FHs,209
26
26
  litpose_app/transcode_fine.py,sha256=YVrKg6IxrLEi0mWVWQqt89NHD6IAwYS512mw-4zkp54,6188
27
- lightning_pose_app-1.8.1a5.dist-info/METADATA,sha256=BGAX4WhTfKrYl4ZR3whh_m2T-WjLxJ6G-uN8fBSdhSw,945
28
- lightning_pose_app-1.8.1a5.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
29
- lightning_pose_app-1.8.1a5.dist-info/RECORD,,
27
+ lightning_pose_app-1.8.1a6.dist-info/METADATA,sha256=BNsYWKmm_MrPjv7TS4NIfkM1DpAkhSHvwgIh9G4fejo,945
28
+ lightning_pose_app-1.8.1a6.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
29
+ lightning_pose_app-1.8.1a6.dist-info/RECORD,,
@@ -9,12 +9,25 @@ def setup_active_task_registry(app: FastAPI):
9
9
  # Get APScheduler instance
10
10
  scheduler: BaseScheduler = app.state.scheduler
11
11
 
12
- subject = reactivex.subject.BehaviorSubject(len(scheduler.get_jobs()))
12
+ subject = reactivex.subject.BehaviorSubject(0)
13
13
 
14
14
  app.state.num_active_transcode_tasks = subject
15
15
 
16
+ _num_active_jobs = 0
17
+
16
18
  def my_listener(event):
17
- jobs = scheduler.get_jobs()
18
- subject.on_next(len(jobs))
19
+ nonlocal _num_active_jobs
20
+ if event.code == e.EVENT_JOB_SUBMITTED:
21
+ _num_active_jobs += 1
22
+ else:
23
+ _num_active_jobs -= 1
24
+
25
+ subject.on_next(_num_active_jobs)
19
26
 
20
- scheduler.add_listener(my_listener, e.EVENT_JOB_ADDED | e.EVENT_JOB_REMOVED)
27
+ scheduler.add_listener(
28
+ my_listener,
29
+ e.EVENT_JOB_SUBMITTED
30
+ | e.EVENT_JOB_EXECUTED
31
+ | e.EVENT_JOB_ERROR
32
+ | e.EVENT_JOB_MISSED,
33
+ )