again...
This commit is contained in:
@@ -386,7 +386,7 @@ async def main():
|
|||||||
setuplogger()
|
setuplogger()
|
||||||
|
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
parser.add_argument("--run-once", action="store_true", help="Run immediately once then exit")
|
parser.add_argument("--runonce", action="store_true", help="Run now and exit (no scheduler)")
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
# Feeds init (list may be reloaded inside task)
|
# Feeds init (list may be reloaded inside task)
|
||||||
@@ -414,7 +414,7 @@ async def main():
|
|||||||
|
|
||||||
LOG.info("Starting bot")
|
LOG.info("Starting bot")
|
||||||
|
|
||||||
if args.run_once:
|
if args.runonce:
|
||||||
await task.daily_task()
|
await task.daily_task()
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
@@ -589,9 +589,9 @@ async def run_forever_sunday_noon():
|
|||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
import argparse
|
import argparse
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
parser.add_argument("--run-once", action="store_true", help="Run now and exit (no scheduler)")
|
parser.add_argument("--runonce", action="store_true", help="Run now and exit (no scheduler)")
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
if args.run_once:
|
if args.runonce:
|
||||||
asyncio.run(run_weekly())
|
asyncio.run(run_weekly())
|
||||||
else:
|
else:
|
||||||
asyncio.run(run_forever_sunday_noon())
|
asyncio.run(run_forever_sunday_noon())
|
||||||
|
|||||||
Reference in New Issue
Block a user