Skip to content

Commit 3fe92ae

Browse files
committed
squashme: minor fix
1 parent 8b584e5 commit 3fe92ae

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

bases/renku_data_services/data_api/main.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,13 @@ async def handle_head(request: Request, response: BaseHTTPResponse) -> None:
115115
if request.method == "HEAD":
116116
response.body = None
117117

118-
@app.main_process_start
118+
@app.before_server_start
119119
async def do_migrations(_: Sanic) -> None:
120120
logger.info("running migrations")
121121
run_migrations_for_app("common")
122122
await config.rp_repo.initialize(config.db.conn_url(async_client=False), config.default_resource_pool)
123123

124-
@app.main_process_start
124+
@app.before_server_start
125125
async def do_solr_migrations(app: Sanic) -> None:
126126
logger.info(f"Running SOLR migrations at: {config.solr_config}")
127127
migrator = SchemaMigrator(config.solr_config)
@@ -137,7 +137,7 @@ async def setup_rclone_validator(app: Sanic) -> None:
137137
validator = RCloneValidator()
138138
app.ext.dependency(validator)
139139

140-
@app.main_process_ready
140+
@app.after_server_start
141141
async def do_solr_reindex(app: Sanic) -> None:
142142
"""Reindex solr if needed."""
143143
if not getattr(app.ctx, "solr_reindex", False):

bases/renku_data_services/data_api/prometheus.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ async def collect_system_metrics(app: Sanic, name: str) -> None:
4444
async def collect_system_metrics_task(app: Sanic) -> None:
4545
"""Background task to collect metrics."""
4646
while True:
47-
await collect_system_metrics(app, app.m.name)
47+
name = app.name if not hasattr(app.multiplexer) else app.multiplexer.name
48+
await collect_system_metrics(app, name)
4849
await asyncio.sleep(5)
4950

5051

0 commit comments

Comments
 (0)