change README.md and default config file
This commit is contained in:
@@ -58,6 +58,9 @@ All arguments except for *job* are optional.
|
||||
# Bad: time.sleep(10)
|
||||
# Good: await asyncio.sleep(10)
|
||||
|
||||
import asyncio
|
||||
import logging
|
||||
|
||||
async def custom_job(event, task_id):
|
||||
await asyncio.sleep(10)
|
||||
logging.info(f"{task_id}: execute example task: {event}")
|
||||
@@ -67,7 +70,8 @@ task_sched = TaskScheduler(
|
||||
files=True,
|
||||
dirs=False,
|
||||
delay=0,
|
||||
logname="sched")
|
||||
logname="sched",
|
||||
global_vars=globals())
|
||||
```
|
||||
|
||||
### ShellScheduler
|
||||
|
||||
@@ -2,14 +2,19 @@
|
||||
# TaskScheduler config #
|
||||
##########################
|
||||
|
||||
#import asyncio
|
||||
#import logging
|
||||
#
|
||||
#async def custom_job(event, task_id):
|
||||
# asyncio.sleep(1)
|
||||
# logging.info(f"{task_id}: execute example task: {event}")
|
||||
#
|
||||
#task_sched = TaskScheduler(
|
||||
# job=custom_job,
|
||||
# files=True,
|
||||
# dirs=False,
|
||||
# delay=10)
|
||||
# delay=10
|
||||
# global_vars=globals())
|
||||
|
||||
|
||||
###########################
|
||||
|
||||
Reference in New Issue
Block a user