File tree 2 files changed +29
-2
lines changed
2 files changed +29
-2
lines changed Original file line number Diff line number Diff line change @@ -133,8 +133,6 @@ def run_worker(
133
133
processing_pool_name : str ,
134
134
process_type : str ,
135
135
) -> None :
136
- # print("!!!!!! STARTING WORKER !!!!!!!")
137
-
138
136
processed_task_count = 0
139
137
140
138
def handle_alarm (signum : int , frame : FrameType | None ) -> None :
Original file line number Diff line number Diff line change
1
+ from datetime import timedelta
2
+
3
+ from django .conf import settings
4
+
5
+ from sentry .conf .types .taskworker import crontab
6
+ from sentry .taskworker .registry import taskregistry
7
+
8
+
9
+ def test_import_paths ():
10
+ for path in settings .TASKWORKER_IMPORTS :
11
+ try :
12
+ __import__ (path )
13
+ except ImportError :
14
+ raise AssertionError (f"Unable to import { path } from TASKWORKER_IMPORTS" )
15
+
16
+
17
+ def test_taskworker_schedule () -> None :
18
+ for schedule_name , config in settings .TASKWORKER_SCHEDULES .items ():
19
+ assert config ["task" ], f"schedule { schedule_name } is missing a task name"
20
+ (namespace , taskname ) = config ["task" ].split (":" )
21
+ assert taskregistry .get_task (
22
+ namespace , taskname
23
+ ), f"task for { schedule_name } is not registered"
24
+
25
+ assert config ["schedule" ], f"Schedule { schedule_name } is missing a schedule"
26
+ schedule = config .get ("schedule" )
27
+ assert isinstance (
28
+ schedule , (timedelta , crontab )
29
+ ), f"Schedule { schedule_name } has a schedule of type { type (schedule )} "
You can’t perform that action at this time.
0 commit comments