Skip to content

fix(backend): add server startup time log in main.py (#3870) - #3961

Open
singhanurag0317-bit wants to merge 1 commit into
riteshbonthalakoti:mainfrom
singhanurag0317-bit:feat/server-startup-time-log
Open

fix(backend): add server startup time log in main.py (#3870)#3961
singhanurag0317-bit wants to merge 1 commit into
riteshbonthalakoti:mainfrom
singhanurag0317-bit:feat/server-startup-time-log

Conversation

@singhanurag0317-bit

@singhanurag0317-bit singhanurag0317-bit commented Jul 28, 2026

Copy link
Copy Markdown

Log the exact UTC timestamp of server initialization at startup for observability. Closes #3870

Summary by CodeRabbit

  • Chores
    • Added a startup log entry showing when server initialization begins.

…oti#3870)

Log the exact UTC timestamp of server initialization at startup for
observability and debugging purposes.

Closes riteshbonthalakoti#3870
@vercel

vercel Bot commented Jul 28, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the ritesh Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The FastAPI lifespan startup handler now records the current UTC timestamp and prints a server initialization message before the existing model-loading sequence.

Changes

Server startup logging

Layer / File(s) Summary
Startup timestamp log
backend/main.py
The lifespan startup routine formats the current UTC time and prints an initialization message before model loading.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Suggested reviewers: riteshbonthalakoti, harshitanagpal05

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: adding a server startup time log in backend/main.py.
Linked Issues check ✅ Passed The PR adds a UTC startup timestamp log during server boot, satisfying issue #3870's requirement.
Out of Scope Changes check ✅ Passed The change is narrowly scoped to startup logging and does not introduce unrelated modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
backend/main.py (1)

221-222: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use datetime.now(datetime.timezone.utc) for this startup timestamp.

datetime.datetime.utcnow() is deprecated in Python 3.12 for returning a naive UTC datetime. This workflow runs with Python 3.12, so replace it with an aware UTC clock to preserve explicit UTC semantics.

Proposed fix
-    startup_time = datetime.datetime.utcnow().strftime("%Y-%m-%d %H:%M:%S UTC")
+    startup_time = datetime.datetime.now(datetime.timezone.utc).strftime("%Y-%m-%d %H:%M:%S UTC")
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@backend/main.py` around lines 221 - 222, Update the startup timestamp
initialization near the server initialization log to use an aware UTC datetime
via datetime.now(datetime.timezone.utc) instead of datetime.datetime.utcnow(),
while preserving the existing formatting and startup message.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@backend/main.py`:
- Around line 221-222: Update the startup timestamp initialization near the
server initialization log to use an aware UTC datetime via
datetime.now(datetime.timezone.utc) instead of datetime.datetime.utcnow(), while
preserving the existing formatting and startup message.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: fe011931-e641-4fa9-a48a-da57034e0091

📥 Commits

Reviewing files that changed from the base of the PR and between da8faf2 and 637a3a5.

📒 Files selected for processing (1)
  • backend/main.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(backend): add server startup time log in main.py

1 participant