more refactor
This commit is contained in:
parent
58e99a1869
commit
76c2dedea3
2 changed files with 5 additions and 1 deletions
|
|
@ -5,6 +5,7 @@ from dataclasses import dataclass
|
|||
ASSUMED_PREHISTORICAL_DATETIME = datetime.datetime.fromtimestamp(0)
|
||||
DESTINATION_COLUMN_NAME = "documents"
|
||||
DEFAULT_BATCH_SIZE = 100
|
||||
COSMOS_DB_TIMESTAMP_FIELD_KEY = "_ts"
|
||||
|
||||
|
||||
@dataclass
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ from anaxi.config import (
|
|||
)
|
||||
from anaxi.constants import (
|
||||
ASSUMED_PREHISTORICAL_DATETIME,
|
||||
COSMOS_DB_TIMESTAMP_FIELD_KEY,
|
||||
DEFAULT_BATCH_SIZE,
|
||||
DESTINATION_COLUMN_NAME,
|
||||
PATHS,
|
||||
|
|
@ -94,7 +95,9 @@ class SyncJob:
|
|||
|
||||
def commit_batch(self, docs_batch, cursor):
|
||||
self.checkpoint_manager.set_new_goal(
|
||||
goal_timestamp=datetime.datetime.fromtimestamp(docs_batch[-1]["_ts"])
|
||||
goal_timestamp=datetime.datetime.fromtimestamp(
|
||||
docs_batch[-1][COSMOS_DB_TIMESTAMP_FIELD_KEY]
|
||||
)
|
||||
)
|
||||
|
||||
json_data = [(json.dumps(d),) for d in docs_batch]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue