reykit 1.1.92__py3-none-any.whl → 1.1.94__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.
reykit/rschedule.py CHANGED
@@ -23,19 +23,19 @@ from .rbase import Base, throw
23
23
 
24
24
 
25
25
  __all__ = (
26
- 'TableSchedule',
26
+ 'DatabaseTableSchedule',
27
27
  'Schedule'
28
28
  )
29
29
 
30
30
 
31
- class TableSchedule(rorm.Model, table=True):
31
+ class DatabaseTableSchedule(rorm.Model, table=True):
32
32
  """
33
33
  Database `schedule` table model.
34
34
  """
35
35
 
36
36
  __comment__ = 'Schedule execute record table.'
37
37
  create_time: rorm.Datetime = rorm.Field(field_default='CURRENT_TIMESTAMP', not_null=True, index_n=True, comment='Record create time.')
38
- update_time: rorm.Datetime = rorm.Field(field_default='CURRENT_TIMESTAMP', index_n=True, comment='Record update time.')
38
+ update_time: rorm.Datetime = rorm.Field(field_default='ON UPDATE CURRENT_TIMESTAMP', index_n=True, comment='Record update time.')
39
39
  id: int = rorm.Field(field_type=rorm.types_mysql.INTEGER(unsigned=True), key_auto=True, comment='ID.')
40
40
  status: str = rorm.Field(field_type=rorm.types_mysql.TINYINT(unsigned=True), not_null=True, comment='Schedule status, 0 is executing, 1 is completed, 2 is occurred error.')
41
41
  task: str = rorm.Field(field_type=rorm.types.VARCHAR(100), not_null=True, comment='Schedule task function name.')
@@ -75,7 +75,7 @@ class Schedule(Base):
75
75
  max_instances : Maximum number of synchronized executions of tasks with the same ID.
76
76
  coalesce : Whether to coalesce tasks with the same ID.
77
77
  block : Whether to block.
78
- db : Database instance.
78
+ db : `Database` instance.
79
79
  - `None`: Not use database.
80
80
  - `Database`: Automatic record to database.
81
81
  """
@@ -108,13 +108,9 @@ class Schedule(Base):
108
108
  self.db = db
109
109
 
110
110
 
111
- def handle_build_db(self) -> tuple[list[type[TableSchedule]], list[dict[str, Any]]]:
111
+ def build_db(self) -> None:
112
112
  """
113
- Handle method of check and build database tables, by `self.db_names`.
114
-
115
- Returns
116
- -------
117
- Build database parameter.
113
+ Check and build database tables, by `self.db_names`.
118
114
  """
119
115
 
120
116
  # Check.
@@ -122,10 +118,10 @@ class Schedule(Base):
122
118
  throw(ValueError, self.db)
123
119
 
124
120
  # Set parameter.
125
- TableSchedule._set_name(self.db_names['schedule'])
126
121
 
127
122
  ## Table.
128
- tables = [TableSchedule]
123
+ DatabaseTableSchedule._set_name(self.db_names['schedule'])
124
+ tables = [DatabaseTableSchedule]
129
125
 
130
126
  ## View stats.
131
127
  views_stats = [
@@ -187,17 +183,6 @@ class Schedule(Base):
187
183
  }
188
184
  ]
189
185
 
190
- return tables, views_stats
191
-
192
-
193
- def build_db(self) -> None:
194
- """
195
- Check and build database tables, by `self.db_names`.
196
- """
197
-
198
- # Get parameter.
199
- tables, views_stats = self.handle_build_db()
200
-
201
186
  # Build.
202
187
  self.db.build.build(tables=tables, views_stats=views_stats, skip=True)
203
188
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: reykit
3
- Version: 1.1.92
3
+ Version: 1.1.94
4
4
  Summary: Kit method set.
5
5
  Project-URL: homepage, https://github.com/reyxbo/reykit/
6
6
  Author-email: Rey <reyxbo@163.com>
@@ -11,7 +11,7 @@ reykit/rnum.py,sha256=jEhPQatAAaIV6kPx2tVtfjuK0F09UCWU6BjfPRamqBE,3620
11
11
  reykit/ros.py,sha256=n9aqChdRQQFozOn_jXQns_UrKoEstCNRzFTgOBel4wM,47787
12
12
  reykit/rrand.py,sha256=kh9yWOW8zaj8bUU0H0RL_GiOs2K8JDviVzKSoPLEuls,8566
13
13
  reykit/rre.py,sha256=uqqved1_SWrJOQK-o5WYRoJf3JH0YpEktnxwA0x7TPU,6018
14
- reykit/rschedule.py,sha256=xQeKlGGKAMsLRIdxIBbd3RHw3O2d9bejq9idK9ZoBzQ,12990
14
+ reykit/rschedule.py,sha256=fQU0oJW9X4_HheHc_3jMdpZY0jzF6Ps8DUvfOdYt7p8,12644
15
15
  reykit/rstdout.py,sha256=bLN_kXsWpgTrCrBJNgaEE27DUk-ojsBV-9YJtWH41b4,8188
16
16
  reykit/rsys.py,sha256=PEXUU_jyglEgIyN-URtnpUcrqKF5PFeAVAljEmaSqOs,24931
17
17
  reykit/rtable.py,sha256=ItsycFuN-gb3gYhHuMx_nbAluGc8tAIMOyD5DHPS-lU,12173
@@ -22,7 +22,7 @@ reykit/rwrap.py,sha256=8MqbOjq56DbDKuTix75wYGXcAykzLiAPKrgl13Gk4xQ,15086
22
22
  reykit/rzip.py,sha256=u-yyEFXY5iOysgzzqEbaaDTFfoHBj0L2sv5m4AQLt1c,3450
23
23
  reykit/rdll/__init__.py,sha256=TEVZjiW9Y1_VxbZgIygcwmRp5xFHM2wLgwZccZ6gjng,698
24
24
  reykit/rdll/rdll_core.py,sha256=o6-rKcTQgxZQe0kD3GnwyNb3KL9IogzgCQNOmYLMm7A,5086
25
- reykit-1.1.92.dist-info/METADATA,sha256=yInLHMpchvta0ERsIz57idu5qdNOoJWLJzzuekf-WQQ,1872
26
- reykit-1.1.92.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
27
- reykit-1.1.92.dist-info/licenses/LICENSE,sha256=UYLPqp7BvPiH8yEZduJqmmyEl6hlM3lKrFIefiD4rvk,1059
28
- reykit-1.1.92.dist-info/RECORD,,
25
+ reykit-1.1.94.dist-info/METADATA,sha256=A6DvMRPsrnardWbFbocuQ72IRMsONVfnZon0l6soyyA,1872
26
+ reykit-1.1.94.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
27
+ reykit-1.1.94.dist-info/licenses/LICENSE,sha256=UYLPqp7BvPiH8yEZduJqmmyEl6hlM3lKrFIefiD4rvk,1059
28
+ reykit-1.1.94.dist-info/RECORD,,