Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions mod_health/controllers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import os
import subprocess
from datetime import datetime
from datetime import datetime, timezone
from typing import Any, Dict, Optional, Tuple

from flask import Blueprint, current_app, jsonify
Expand Down Expand Up @@ -79,7 +79,7 @@ def health_check() -> Tuple[Any, int]:

checks: Dict[str, Any] = {
'status': 'healthy' if all_healthy else 'unhealthy',
'timestamp': datetime.utcnow().isoformat() + 'Z',
'timestamp': datetime.now(timezone.utc).replace(tzinfo=None).isoformat() + 'Z',
'checks': check_results
}

Expand All @@ -99,7 +99,7 @@ def liveness_check() -> Tuple[Any, int]:
"""
return jsonify({
'status': 'alive',
'timestamp': datetime.utcnow().isoformat() + 'Z'
'timestamp': datetime.now(timezone.utc).replace(tzinfo=None).isoformat() + 'Z'
}), 200


Expand Down Expand Up @@ -172,7 +172,7 @@ def version_check() -> Tuple[Any, int]:
git_info = get_git_info()

response = {
'timestamp': datetime.utcnow().isoformat() + 'Z',
'timestamp': datetime.now(timezone.utc).replace(tzinfo=None).isoformat() + 'Z',
'git': git_info,
}

Expand Down
Loading