diff --git a/.github/workflows/build_all.yml b/.github/workflows/build_all.yml index 402b267..d839691 100644 --- a/.github/workflows/build_all.yml +++ b/.github/workflows/build_all.yml @@ -59,7 +59,10 @@ jobs: - uses: actions/download-artifact@v3 with: name: minecraft-launcher-server - + + - name: chmod + run: chmod +x minecraft-launcher-server + - name: Prepare ssh env: SSH_FINGERPRINT: ${{secrets.SSH_FINGERPRINT}} @@ -67,7 +70,7 @@ jobs: mkdir -p ~/.ssh echo "$SSH_FINGERPRINT" >> ~/.ssh/known_hosts shell: bash - + - name: Upload files env: SSHPASS: ${{secrets.SSH_PASSWORD}} diff --git a/minecraft-launcher-server/Server.cs b/minecraft-launcher-server/Server.cs index 73c82aa..b20628f 100644 --- a/minecraft-launcher-server/Server.cs +++ b/minecraft-launcher-server/Server.cs @@ -38,7 +38,8 @@ static class Server Config = ServerConfig.LoadOrCreateDefault(); CheckUpdates(); - updateCheckTimer = new Timer(true, 5 * 60 * 1000, CheckUpdates); + // check for updates every minute + updateCheckTimer = new Timer(true, 60 * 1000, CheckUpdates); updateCheckTimer.Start(); @@ -89,7 +90,9 @@ static class Server File.Move(exeFileNew, exeFile, true); Environment.Exit(0); } - else File.Move(updatedFilePath, relativeFilePath, true); + + logger.LogDebug(nameof(CheckUpdates), "updating file "+relativeFilePath); + File.Move(updatedFilePath, relativeFilePath, true); } catch (Exception e) { @@ -97,9 +100,12 @@ static class Server + e.ToStringDemystified()); } } - logger.LogInfo(nameof(CheckUpdates), "creating manifests..."); - Manifests.CreateAllManifests(); - logger.LogInfo(nameof(CheckUpdates), "manifests created"); + if(updatedFiles.Count != 0) + { + logger.LogInfo(nameof(CheckUpdates), "creating manifests..."); + Manifests.CreateAllManifests(); + logger.LogInfo(nameof(CheckUpdates), "manifests created"); + } logger.LogInfo(nameof(CheckUpdates), "update check completed"); }