Skip to content

Commit

Permalink
feat: use default time
Browse files Browse the repository at this point in the history
  • Loading branch information
ayuki-joto committed Oct 21, 2024
1 parent b147a78 commit a3570a9
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions etl/src/birdxplorer_etl/settings.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
import os
import time
from dotenv import load_dotenv

load_dotenv()

# 現在の時間から4時間(14400秒)前をミリ秒で取得
four_hour_ago_millis = int((time.time() - 14400) * 1000)
now_millis = int((time.time()) * 1000)

# TARGET_TWITTER_POST_START_UNIX_MILLISECOND = int(
# os.getenv("TARGET_TWITTER_POST_START_UNIX_MILLISECOND", "1717729500000")
# )
TARGET_TWITTER_POST_START_UNIX_MILLISECOND = int(
os.getenv("TARGET_TWITTER_POST_START_UNIX_MILLISECOND", "1717729500000")
os.getenv("TARGET_TWITTER_POST_START_UNIX_MILLISECOND", str(four_hour_ago_millis))
)
# 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", str(now_millis))
)
TARGET_TWITTER_POST_END_UNIX_MILLISECOND = int(os.getenv("TARGET_TWITTER_POST_END_UNIX_MILLISECOND", "1717729610000"))

# Extractで何日前のデータを最新と定義するか。開発中は3日前が楽。
COMMUNITY_NOTE_DAYS_AGO = int(os.getenv("COMMUNITY_NOTE_DAYS_AGO", "3"))
Expand All @@ -15,7 +26,13 @@
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")
TARGET_NOTE_ESTIMATE_TOPIC_START_UNIX_MILLISECOND = int(
os.getenv("TARGET_NOTE_ESTIMATE_TOPIC_START_UNIX_MILLISECOND", str(four_hour_ago_millis))
)
# TARGET_NOTE_ESTIMATE_TOPIC_END_UNIX_MILLISECOND = os.getenv("TARGET_NOTE_ESTIMATE_TOPIC_END_UNIX_MILLISECOND")
TARGET_NOTE_ESTIMATE_TOPIC_END_UNIX_MILLISECOND = int(
os.getenv("TARGET_NOTE_ESTIMATE_TOPIC_END_UNIX_MILLISECOND", str(four_hour_ago_millis))
)

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

0 comments on commit a3570a9

Please sign in to comment.