Skip to content

Commit

Permalink
Merge pull request #114 from dreulavelle/health_endpoint
Browse files Browse the repository at this point in the history
Add initialized status to app health endpoint
  • Loading branch information
Gaisberg authored Jan 6, 2024
2 parents a1bae19 + 0dd7c03 commit bd1cc94
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions backend/controllers/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ async def root():


@router.get("/health")
async def health():
async def health(request: Request):
return {
"success": True,
"message": "Iceburg is running!",
"message": request.app.program.initialized,
}


Expand Down
3 changes: 2 additions & 1 deletion backend/program/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def __init__(self):

def start(self):
logger.info("Iceberg v%s starting!", settings.get("version"))
self.initialized = False
self.media_items = MediaItemContainer(items=[])
self.data_path = get_data_path()
if not os.path.exists(self.data_path):
Expand All @@ -39,7 +40,7 @@ def start(self):
logger.info("----------------------------------------------")
super().start()
self.running = True

self.initialized = True

def run(self):
while self.running:
Expand Down

0 comments on commit bd1cc94

Please sign in to comment.