fix: close release preflight gaps
Route public health checks to the API, backfill and synchronize job opportunities, stabilize SPA smoke tests, and document operator-only production steps.
This commit is contained in:
@@ -2111,8 +2111,9 @@ public static class StartupInitializationExtensions
|
||||
|
||||
var companyOwnershipExists = ColumnExists(conn, provider, "Companies", "OwnerUserId");
|
||||
var jobOwnershipExists = ColumnExists(conn, provider, "JobApplications", "OwnerUserId");
|
||||
var opportunityOwnershipExists = ColumnExists(conn, provider, "Jobs", "OwnerUserId");
|
||||
|
||||
if (companyOwnershipExists || jobOwnershipExists)
|
||||
if (companyOwnershipExists || jobOwnershipExists || opportunityOwnershipExists)
|
||||
{
|
||||
if (companyOwnershipExists)
|
||||
{
|
||||
@@ -2123,6 +2124,11 @@ public static class StartupInitializationExtensions
|
||||
{
|
||||
adminDb.Database.ExecuteSqlRaw("UPDATE JobApplications SET OwnerUserId = {0} WHERE OwnerUserId IS NULL;", admin.Id);
|
||||
}
|
||||
|
||||
if (opportunityOwnershipExists)
|
||||
{
|
||||
adminDb.Database.ExecuteSqlRaw("UPDATE Jobs SET OwnerUserId = {0} WHERE OwnerUserId IS NULL;", admin.Id);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -2173,6 +2179,14 @@ public static class StartupInitializationExtensions
|
||||
}
|
||||
}
|
||||
|
||||
using (var scope = app.Services.CreateScope())
|
||||
{
|
||||
var db = scope.ServiceProvider.GetRequiredService<JobTrackerContext>();
|
||||
var backfilled = JobOpportunitySync.BackfillLegacyAsync(db).GetAwaiter().GetResult();
|
||||
if (backfilled > 0)
|
||||
app.Logger.LogInformation("Backfilled {Count} legacy job opportunities.", backfilled);
|
||||
}
|
||||
|
||||
var readiness = app.Services.GetRequiredService<IStartupReadiness>();
|
||||
readiness.MarkReady();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user