Skip to content

Commit

Permalink
set default date for etl
Browse files Browse the repository at this point in the history
  • Loading branch information
yu23ki14 committed Oct 25, 2024
1 parent 8d773a8 commit 6da5141
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions etl/src/birdxplorer_etl/settings.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import os
from dotenv import load_dotenv
from datetime import datetime, timedelta

load_dotenv()

default_start_time = int(datetime.combine(datetime.now() - timedelta(days=2), datetime.min.time()).timestamp() * 1000)
default_end_time = int(datetime.now().timestamp() * 1000)

TARGET_TWITTER_POST_START_UNIX_MILLISECOND = int(
os.getenv("TARGET_TWITTER_POST_START_UNIX_MILLISECOND", "1717729500000")
os.getenv("TARGET_TWITTER_POST_START_UNIX_MILLISECOND", default_start_time)
)
TARGET_TWITTER_POST_END_UNIX_MILLISECOND = int(os.getenv("TARGET_TWITTER_POST_END_UNIX_MILLISECOND", "1717729610000"))
TARGET_TWITTER_POST_END_UNIX_MILLISECOND = int(os.getenv("TARGET_TWITTER_POST_END_UNIX_MILLISECOND", default_end_time))

# Extractで何日前のデータを最新と定義するか。開発中は3日前が楽。
COMMUNITY_NOTE_DAYS_AGO = int(os.getenv("COMMUNITY_NOTE_DAYS_AGO", "3"))
Expand All @@ -15,8 +19,12 @@
AI_MODEL = os.getenv("AI_MODEL")
OPENAPI_TOKEN = os.getenv("OPENAPI_TOKEN")
CLAUDE_TOKEN = os.getenv("CLAUDE_TOKEN")
TARGET_NOTE_ESTIMATE_TOPIC_START_UNIX_MILLISECOND = os.getenv("TARGET_NOTE_ESTIMATE_TOPIC_START_UNIX_MILLISECOND")
TARGET_NOTE_ESTIMATE_TOPIC_END_UNIX_MILLISECOND = os.getenv("TARGET_NOTE_ESTIMATE_TOPIC_END_UNIX_MILLISECOND")
TARGET_NOTE_ESTIMATE_TOPIC_START_UNIX_MILLISECOND = os.getenv(
"TARGET_NOTE_ESTIMATE_TOPIC_START_UNIX_MILLISECOND", default_start_time
)
TARGET_NOTE_ESTIMATE_TOPIC_END_UNIX_MILLISECOND = os.getenv(
"TARGET_NOTE_ESTIMATE_TOPIC_END_UNIX_MILLISECOND", default_end_time
)

USE_DUMMY_DATA = os.getenv("USE_DUMMY_DATA", "False") == "True"

Expand Down

0 comments on commit 6da5141

Please sign in to comment.