Skip to content
Merged

z #15

Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion Portable/JobTracker-x64.zip.001
Git LFS file not shown
4 changes: 2 additions & 2 deletions Portable/JobTracker-x64.zip.002
Git LFS file not shown
2 changes: 1 addition & 1 deletion Portable/JobTracker-x86.zip.001
Git LFS file not shown
4 changes: 2 additions & 2 deletions Portable/JobTracker-x86.zip.002
Git LFS file not shown
1 change: 1 addition & 0 deletions Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@
builder.Services.AddTransient<EmailReplyMatcher>();
builder.Services.AddTransient<EmailJobAlertParser>();
builder.Services.AddTransient<EmailCheckJob>();
builder.Services.AddTransient<JsaActivityModeJob>();
builder.Services.AddSingleton<AppShutdownService>();

// Update check — lightweight singleton that queries GitHub releases once
Expand Down
9 changes: 6 additions & 3 deletions Services/LocalBackgroundService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,17 @@ public class LocalBackgroundService : BackgroundService
_ => ""
};

public LocalBackgroundService(IServiceScopeFactory scopeFactory, ILogger<LocalBackgroundService> logger, IWebHostEnvironment env)
public LocalBackgroundService(IServiceScopeFactory scopeFactory, ILogger<LocalBackgroundService> logger, IWebHostEnvironment env, IStorageBackend storageBackend)
{
_scopeFactory = scopeFactory;
_logger = logger;
_configPath = Path.Combine(env.ContentRootPath, "Data", "background-jobs.json");

// JSA Activity Mode is only available when the data directory contains "passp"
_jsaActivityEnabled = _configPath.Contains("passp", StringComparison.OrdinalIgnoreCase);
// JSA Activity Mode is only available when the user data directory path contains "passp"
var dataDir = storageBackend is JsonStorageBackend jsonBackend
? jsonBackend.GetDataDirectory()
: env.ContentRootPath;
_jsaActivityEnabled = dataDir.Contains("passp", StringComparison.OrdinalIgnoreCase);
Comment on lines 94 to +100
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_configPath is still hardcoded to env.ContentRootPath/Data/background-jobs.json, but the app supports a custom data directory via data-directory.config (used when constructing JsonStorageBackend). When a custom data dir is configured, the background job config will be read/written in the wrong folder and won’t be included in JSON backups. Consider deriving _configPath from the JSON backend data directory (e.g., jsonBackend.GetDataDirectory()) when available, and only fall back to env.ContentRootPath when not using JSON storage.

Copilot uses AI. Check for mistakes.

// Initialize defaults (disabled until user enables them)
var hasConfig = File.Exists(_configPath);
Expand Down
Loading