task.py 845 B

1234567891011121314151617181920212223242526272829303132333435
  1. # This Python file uses the following encoding: utf-8
  2. # @author runhey
  3. # github https://github.com/runhey
  4. from time import sleep
  5. from datetime import datetime, time
  6. from random import randint
  7. from module.config.config import Config
  8. class Task:
  9. def __init__(self,
  10. task_name: str, # 任务名称,必须是大写的
  11. next_run: datetime,
  12. limit_time: time,
  13. target_run: datetime = None,
  14. team_task: bool = False,
  15. role: str = 'leader',
  16. limit_count: int = 0,
  17. ):
  18. self.task_name = task_name
  19. self.next_run = next_run
  20. self.target_run = target_run
  21. self.limit_time = limit_time
  22. self.team_task = team_task
  23. self.role = role
  24. self.limit_count = limit_count