task.py 742 B

123456789101112131415161718192021222324252627282930313233
  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. next_run: datetime,
  11. limit_time: time,
  12. target_run: datetime = None,
  13. team_task: bool = False,
  14. role: str = 'leader',
  15. limit_count: int = 0,
  16. ):
  17. self.next_run = next_run
  18. self.target_run = target_run
  19. self.limit_time = limit_time
  20. self.team_task = team_task
  21. self.role = role
  22. self.limit_count = limit_count