schd 0.0.14__tar.gz → 0.0.16__tar.gz
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.
- {schd-0.0.14 → schd-0.0.16}/PKG-INFO +1 -1
- schd-0.0.16/schd/__init__.py +1 -0
- {schd-0.0.14 → schd-0.0.16}/schd/cmds/jobs.py +1 -4
- {schd-0.0.14 → schd-0.0.16}/schd/cmds/run.py +2 -5
- {schd-0.0.14 → schd-0.0.16}/schd/schedulers/remote.py +11 -8
- {schd-0.0.14 → schd-0.0.16}/schd.egg-info/PKG-INFO +1 -1
- {schd-0.0.14 → schd-0.0.16}/setup.py +1 -1
- schd-0.0.14/schd/__init__.py +0 -1
- {schd-0.0.14 → schd-0.0.16}/LICENSE +0 -0
- {schd-0.0.14 → schd-0.0.16}/README.md +0 -0
- {schd-0.0.14 → schd-0.0.16}/schd/cmds/__init__.py +0 -0
- {schd-0.0.14 → schd-0.0.16}/schd/cmds/base.py +0 -0
- {schd-0.0.14 → schd-0.0.16}/schd/cmds/daemon.py +0 -0
- {schd-0.0.14 → schd-0.0.16}/schd/cmds/schd.py +0 -0
- {schd-0.0.14 → schd-0.0.16}/schd/config.py +0 -0
- {schd-0.0.14 → schd-0.0.16}/schd/job.py +0 -0
- {schd-0.0.14 → schd-0.0.16}/schd/scheduler.py +0 -0
- {schd-0.0.14 → schd-0.0.16}/schd/schedulers/__init__.py +0 -0
- {schd-0.0.14 → schd-0.0.16}/schd/util.py +0 -0
- {schd-0.0.14 → schd-0.0.16}/schd.egg-info/SOURCES.txt +0 -0
- {schd-0.0.14 → schd-0.0.16}/schd.egg-info/dependency_links.txt +0 -0
- {schd-0.0.14 → schd-0.0.16}/schd.egg-info/entry_points.txt +0 -0
- {schd-0.0.14 → schd-0.0.16}/schd.egg-info/requires.txt +0 -0
- {schd-0.0.14 → schd-0.0.16}/schd.egg-info/top_level.txt +0 -0
- {schd-0.0.14 → schd-0.0.16}/setup.cfg +0 -0
- {schd-0.0.14 → schd-0.0.16}/tests/test_scheduler.py +0 -0
- {schd-0.0.14 → schd-0.0.16}/tests/test_util.py +0 -0
@@ -0,0 +1 @@
|
|
1
|
+
__version__ = '0.0.16'
|
@@ -12,8 +12,5 @@ class JobsCommand(CommandBase):
|
|
12
12
|
|
13
13
|
def run(self, args):
|
14
14
|
config = read_config(config_file=args.config)
|
15
|
-
for job_name,
|
16
|
-
job_class_name = job_config.pop('class')
|
17
|
-
job_cron = job_config.pop('cron')
|
18
|
-
# print(f'{job_name} : {job_class_name} {job_cron}')
|
15
|
+
for job_name, _ in config.jobs.items():
|
19
16
|
print(job_name)
|
@@ -1,5 +1,4 @@
|
|
1
1
|
import logging
|
2
|
-
import yaml
|
3
2
|
from schd.cmds.base import CommandBase
|
4
3
|
from schd.scheduler import build_job, read_config, JobContext
|
5
4
|
|
@@ -7,11 +6,9 @@ from schd.scheduler import build_job, read_config, JobContext
|
|
7
6
|
def run_job(config_file, job_name):
|
8
7
|
config = read_config(config_file)
|
9
8
|
|
10
|
-
job_config = config
|
9
|
+
job_config = config.jobs[job_name]
|
11
10
|
|
12
|
-
|
13
|
-
job_cron = job_config.pop('cron')
|
14
|
-
job = build_job(job_name, job_class_name, job_config)
|
11
|
+
job = build_job(job_name, job_config.cls, job_config)
|
15
12
|
job_context = JobContext(job_name)
|
16
13
|
job_context.output_to_console = True
|
17
14
|
job(context=job_context)
|
@@ -76,8 +76,8 @@ class RemoteApiClient:
|
|
76
76
|
data.add_field('logfile', f, filename=os.path.basename(logfile_path), content_type='application/octet-stream')
|
77
77
|
|
78
78
|
async with session.put(upload_url, data=data) as resp:
|
79
|
-
|
80
|
-
|
79
|
+
logger.info("Status: %d", resp.status)
|
80
|
+
logger.info("Response: %s", await resp.text())
|
81
81
|
|
82
82
|
|
83
83
|
class RemoteScheduler:
|
@@ -107,7 +107,7 @@ class RemoteScheduler:
|
|
107
107
|
logger.info('start_main_loop ')
|
108
108
|
try:
|
109
109
|
async for event in self.client.subscribe_worker_eventstream(self._worker_name):
|
110
|
-
|
110
|
+
logger.info('got event, %s', event)
|
111
111
|
job_name = event['data']['job_name']
|
112
112
|
instance_id = event['data']['id']
|
113
113
|
_, queue_name = self._jobs[job_name]
|
@@ -146,12 +146,15 @@ class RemoteScheduler:
|
|
146
146
|
logger.info('starting job %s@%d', job_name, instance_id)
|
147
147
|
await self.client.update_job_instance(self._worker_name, job_name, instance_id, status='RUNNING')
|
148
148
|
try:
|
149
|
+
def execute_job():
|
150
|
+
with redirect_stdout(text_stream):
|
151
|
+
job_result = job.execute(context)
|
152
|
+
return job_result
|
153
|
+
|
149
154
|
loop = asyncio.get_running_loop()
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
None, job.execute, context
|
154
|
-
)
|
155
|
+
job_result = await loop.run_in_executor(
|
156
|
+
None, execute_job
|
157
|
+
)
|
155
158
|
|
156
159
|
if job_result is None:
|
157
160
|
ret_code = 0
|
schd-0.0.14/schd/__init__.py
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
__version__ = '0.0.14'
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|