Skip to content

Commit 0f3ef19

Browse files
committed
Merge branch 'develop' into main
2 parents 32fcf4e + 1cef413 commit 0f3ef19

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
All notable changes to this project will be documented in this file.
44
This format follows [Keep a Changelog](https://keepachangelog.com/) and adheres to [Semantic Versioning](https://semver.org/).
55

6+
## [v2.2.3] – 2026-03-06
7+
### Changed
8+
- Added cron fallback defaults for blob ingestion jobs when `CRON_RUN_BLOB_INDEX` and `CRON_RUN_BLOB_PURGE` are not configured: blob indexing now runs hourly (`0 * * * *`) and blob purge runs at 10 minutes past each hour (`10 * * * *`).
9+
610
## [v2.2.2] – 2026-02-04
711
### Fixed
812
- Fixed Docker builds on ARM-based machines by explicitly setting the target platform to `linux/amd64`, preventing Azure Container Apps deployment failures.

main.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,16 @@ def _resolve_timezone():
5050
async def lifespan(app: FastAPI):
5151

5252
# scheduler helper
53-
def _schedule(env_key: str, func, job_id: str, human_name: str) -> bool:
53+
def _schedule(env_key: str, func, job_id: str, human_name: str, default_cron: str | None = None) -> bool:
5454
"""Schedule a cron job from App Configuration.
5555
56-
Returns True when the cron environment key is set and the job was added.
56+
Returns True when a cron expression is available and the job was added.
5757
"""
5858
cron_expr = app_config_client.get(env_key, default=None, allow_none=True)
59+
if not cron_expr and default_cron:
60+
cron_expr = default_cron
61+
logging.info(f"[{human_name}] {env_key} not set - using default cron: {default_cron}")
62+
5963
if cron_expr:
6064
try:
6165
trigger = CronTrigger.from_crontab(cron_expr, timezone=local_tz)
@@ -141,8 +145,8 @@ def _quiet_azure_sdks():
141145
s_sharepoint_index = _schedule("CRON_RUN_SHAREPOINT_INDEX", run_sharepoint_index, "sharepoint_index", "sharepoint-indexer")
142146
s_sharepoint_purge = _schedule("CRON_RUN_SHAREPOINT_PURGE", run_sharepoint_purge, "sharepoint_purge", "sharepoint-purger")
143147
s_images_purge = _schedule("CRON_RUN_IMAGES_PURGE", run_images_purge, "multimodality_images_purge", "multimodality-images-purger")
144-
s_blob_index = _schedule("CRON_RUN_BLOB_INDEX", run_blob_index, "blob_index", "blob-storage-indexer")
145-
s_blob_purge = _schedule("CRON_RUN_BLOB_PURGE", run_blob_purge, "blob_purge", "blob-storage-indexer-purger")
148+
s_blob_index = _schedule("CRON_RUN_BLOB_INDEX", run_blob_index, "blob_index", "blob-storage-indexer", default_cron="0 * * * *")
149+
s_blob_purge = _schedule("CRON_RUN_BLOB_PURGE", run_blob_purge, "blob_purge", "blob-storage-indexer-purger", default_cron="10 * * * *")
146150
s_nl2sql_index = _schedule("CRON_RUN_NL2SQL_INDEX", run_nl2sql_index, "nl2sql_index", "nl2sql-indexer")
147151
s_nl2sql_purge = _schedule("CRON_RUN_NL2SQL_PURGE", run_nl2sql_purge, "nl2sql_purge", "nl2sql-indexer-purger")
148152

@@ -163,8 +167,8 @@ def _quiet_azure_sdks():
163167
startup_task: asyncio.Task | None = None
164168

165169
async def _run_startup_jobs() -> None:
166-
# If a CRON variable was defined for a job, run it once sequentially.
167-
# Only run jobs whose CRON env var existed (the `_schedule` helper returned True).
170+
# If a job was scheduled (env var provided or default cron fallback), run it once sequentially.
171+
# Only run jobs whose `_schedule` helper returned True.
168172
try:
169173
if s_blob_index:
170174
logging.info("[startup] Running blob-storage-indexer immediately")

0 commit comments

Comments
 (0)