internal 1.0.74__py3-none-any.whl → 1.0.75__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of internal might be problematic. Click here for more details.

internal/base_factory.py CHANGED
@@ -40,14 +40,20 @@ class BaseFactory(metaclass=ABCMeta):
40
40
  Each factory should define what model it wants.
41
41
  """
42
42
 
43
+ @abstractmethod
43
44
  async def init_state_cache(self, app, app_config):
45
+ """
46
+ Each factory should define what model it wants.
47
+ """
48
+
49
+ async def init_redis(self, app, app_config):
44
50
  if app_config.REDIS_URL:
45
51
  redis_cache = cache_redis.CacheRedis(app_config.REDIS_URL)
46
52
  await redis_cache.connect()
47
53
  app.state.redis = redis_cache.client
48
- app.state.logger.info("Initialization state cache done")
54
+ app.state.logger.info("Initialization redis done")
49
55
  else:
50
- app.state.logger.info("skip initialization state cache")
56
+ app.state.logger.info("skip initialization redis")
51
57
 
52
58
  async def init_state_scheduler_app(self, app, app_config):
53
59
  """
@@ -72,8 +78,10 @@ class BaseFactory(metaclass=ABCMeta):
72
78
  await init_beanie(database=app.state.db.get_database(), document_models=document_model_list)
73
79
  app.state.logger.info("Database connected")
74
80
  await self.init_state_cache(app, self.get_app_config())
81
+ app.state.logger.info("Initialization state cache done")
75
82
  await self.init_state_scheduler_app(app, self.get_app_config())
76
83
  app.state.logger.info("Initialization state scheduler app done")
84
+ await self.init_redis(app, self.get_app_config())
77
85
 
78
86
  yield
79
87
  # code to execute when app is shutting down
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: internal
3
- Version: 1.0.74
3
+ Version: 1.0.75
4
4
  Summary:
5
5
  Author: Ray
6
6
  Author-email: ray@cruisys.com
@@ -1,6 +1,6 @@
1
1
  internal/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  internal/base_config.py,sha256=TykK9HNF9y3OcIBPgx0h3VfVW5XH7nClLReq1-cqZCg,1995
3
- internal/base_factory.py,sha256=eQugYtImzQTnh6lR4vfVza-K2Q5gcVJnGUOuEPyQB3A,10313
3
+ internal/base_factory.py,sha256=ILsxsIoD8K6pVfI1y9dcQujM7BmCP3T_cmHxNK54-1w,10582
4
4
  internal/cache_redis.py,sha256=YMsrUXHd-wKjsjsboD79Y-ciBBowzT6aAjdJZ36-yEY,697
5
5
  internal/common_enum/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  internal/common_enum/contact_type.py,sha256=7QkTQ71UxpaT1YHI40FpjmLz3r-UbRU-sd0m5ajH1as,142
@@ -33,6 +33,6 @@ internal/model/base_model.py,sha256=NS_GZvw_IqU1aZPHPpyQs6A741O34ybmzVzBPm9nGWU,
33
33
  internal/model/operate.py,sha256=QSM6yXYXpJMwrqkUGEWZLrEBaUgqHwVHY_Fi4S42hKc,3190
34
34
  internal/utils.py,sha256=CXYZs4rDDe33Zac27YeknBE4uQN437ys1YAbW3Xeyow,1517
35
35
  internal/validator_utils.py,sha256=5ZLcNIgw1hvkYOj1f6gS9AYxe7Y3ufW9FyDxUS7FsMQ,1226
36
- internal-1.0.74.dist-info/METADATA,sha256=lG1QJqLdmV2i9Z_UKLq5tvhfo5IPS0tZWKBSeOb9esc,663
37
- internal-1.0.74.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
38
- internal-1.0.74.dist-info/RECORD,,
36
+ internal-1.0.75.dist-info/METADATA,sha256=sugv1q3kQbJYFl4sMmJ7M_BS8tXmFjc2pGl7nbTvAJA,663
37
+ internal-1.0.75.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
38
+ internal-1.0.75.dist-info/RECORD,,