Skip to content

Commit 827a2d6

Browse files
committed
Change worker to ScheduledWorker
1 parent 956ac03 commit 827a2d6

File tree

1 file changed

+2
-19
lines changed

1 file changed

+2
-19
lines changed

investing_bot_framework/core/data_providers/data_provider.py

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
from typing import Dict, Any
33
from abc import abstractmethod
44

5-
from investing_bot_framework.core.workers import Worker
6-
from investing_bot_framework.core.utils import TimeUnit
5+
from investing_bot_framework.core.workers import ScheduledWorker
76

87
logger = logging.getLogger(__name__)
98

@@ -22,7 +21,7 @@ def __str__(self) -> str:
2221
return self.message
2322

2423

25-
class DataProvider(Worker):
24+
class DataProvider(ScheduledWorker):
2625
"""
2726
Class DataProvider: An entity which responsibility is to provide data_providers from an external data_providers
2827
source. Where a data_providers source is defined as any third party service that provides data_providers,
@@ -32,22 +31,6 @@ class DataProvider(Worker):
3231
observers will not be updated.
3332
"""
3433

35-
def get_time_unit(self) -> TimeUnit:
36-
assert getattr(self, 'time_unit', None) is not None, (
37-
"{} should either include a time_unit attribute, or override the "
38-
"`get_time_unit()`, method.".format(self.__class__.__name__)
39-
)
40-
41-
return getattr(self, 'time_unit')
42-
43-
def get_time_interval(self) -> int:
44-
assert getattr(self, 'time_interval', None) is not None, (
45-
"{} should either include a time_interval attribute, or override the "
46-
"`get_time_interval()`, method.".format(self.__class__.__name__)
47-
)
48-
49-
return getattr(self, 'time_interval')
50-
5134
@abstractmethod
5235
def provide_data(self) -> None:
5336
pass

0 commit comments

Comments
 (0)