Skip to content

Commit

Permalink
Changes:
Browse files Browse the repository at this point in the history
- fix crash when no tasks are provided
- fix hard to ignore UserWarning for a perfectly fine
  configuration without tasks
  • Loading branch information
devkral committed Oct 1, 2024
1 parent 4f76f83 commit 9eb026f
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions esmerald/contrib/schedulers/asyncz/config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import warnings
from datetime import datetime, timezone as dtimezone
from typing import Any, Callable, Dict, Type, Union

Expand Down Expand Up @@ -41,7 +40,7 @@ def __init__(
"""
super().__init__(**kwargs)
self.scheduler_class = scheduler_class
self.tasks = tasks
self.tasks = tasks or {}
self.timezone = timezone
self.configurations = configurations
self.options = kwargs
Expand All @@ -50,13 +49,6 @@ def __init__(
if not isinstance(task, str) or not isinstance(module, str):
raise ImproperlyConfigured("The dict of tasks must be Dict[str, str].")

if not self.tasks:
warnings.warn(
"Esmerald is starting the scheduler, yet there are no tasks declared.",
UserWarning,
stacklevel=2,
)

# Load the scheduler object
self.handler = self.get_scheduler(
scheduler=self.scheduler_class,
Expand Down

0 comments on commit 9eb026f

Please sign in to comment.