mirror of
https://github.com/StarFleetCPTN/GoMFT.git
synced 2026-10-10 00:07:27 +02:00
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:
1 parent
bb75bc9400
commit
46df27e8c6
4 files changed
+36
-18
No files matched your search
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user