feat: Add rclone config regeneration after API updates

- Implemented logic to regenerate the rclone config file after updating configurations in the database.
- Added logging to capture warnings if the regeneration fails, while ensuring the update process continues smoothly.
- Enhanced user feedback by logging successful regeneration of the rclone config.
This commit is contained in:
StarFleetCPTN committed 2025-04-07 19:02:02 -07:00
1 parent bb75bc9400
commit 46df27e8c6
4 files changed
+36 -18

No files matched your search

+7
View File
@@ -2,6 +2,7 @@ package api
import (
"fmt"
"log"
"net/http"
"strings"
"time"
@@ -294,6 +295,12 @@ func handleUpdateConfig(database *db.DB) gin.HandlerFunc {
return
}
// Regenerate the rclone config file
if err := database.GenerateRcloneConfig(&updatedConfig); err != nil {
// Log the error but continue anyway as the config was updated in the database
log.Printf("Warning: Failed to regenerate rclone config after API update: %v", err)
}
c.JSON(http.StatusOK, updatedConfig)
}
}