Fix Linux background sync service code review issues

- Fix subprocess_helper_command_str to use Process.spawn_command_line_sync (line 148)
- Improve comment for fetch_subscriptions_needing_sync placeholder (line 303)

These fixes address issues identified in code review for FRE-531.
This commit is contained in:
2026-03-31 06:26:52 -04:00
parent 9ce750bed6
commit d09efb3aa2
2 changed files with 51 additions and 168 deletions

View File

@@ -145,8 +145,18 @@ public class BackgroundSyncService : Object {
public bool are_background_tasks_enabled() {
// Check if systemd timer is active
try {
var result = subprocess_helper_command_str(
"systemctl", "is-enabled", "rssuper-sync.timer");
var stdout, stderr;
var exit_status = Process.spawn_command_line_sync(
"systemctl is-enabled rssuper-sync.timer",
out stdout, out stderr
);
if (exit_status != 0) {
// Timer might not be installed
return true;
}
var result = stdout.to_string();
return result.strip() == "enabled";
} catch (Error e) {
// Timer might not be installed
@@ -302,7 +312,8 @@ public class SyncWorker : Object {
*/
private List<Subscription> fetch_subscriptions_needing_sync() {
// TODO: Replace with actual database query
// For now, return empty list as placeholder
// This is a placeholder that returns an empty list until the database layer is implemented
// Once database is available, query subscriptions where last_sync_at + interval < now
return new List<Subscription>();
}