mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-28 22:48:45 +00:00
fix: adjust scaling command in backupVolume function
- Updated the backupVolume function to use the actual number of replicas when scaling services back up after a backup, improving accuracy in service management. - Enhanced command generation for application service types to ensure proper restoration of service states.
This commit is contained in:
@@ -32,8 +32,9 @@ const backupVolume = async (
|
|||||||
if (serviceType === "application") {
|
if (serviceType === "application") {
|
||||||
return `
|
return `
|
||||||
docker service scale ${volumeBackup.application?.appName}=0
|
docker service scale ${volumeBackup.application?.appName}=0
|
||||||
|
ACTUAL_REPLICAS=$(docker service inspect ${volumeBackup.application?.appName} --format "{{.Spec.Mode.Replicated.Replicas}}")
|
||||||
${baseCommand}
|
${baseCommand}
|
||||||
docker service scale ${volumeBackup.application?.appName}=1
|
docker service scale ${volumeBackup.application?.appName}=$ACTUAL_REPLICAS
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
if (serviceType === "compose") {
|
if (serviceType === "compose") {
|
||||||
|
|||||||
Reference in New Issue
Block a user