From c4c1a6d064eb8a24e3cf65c5c632d95654381318 Mon Sep 17 00:00:00 2001 From: Ns2Kracy <89824014+Ns2Kracy@users.noreply.github.com> Date: Tue, 3 Sep 2024 15:41:04 +0800 Subject: [PATCH] fix: handle empty release file path during cronjob execution (#173) --- service/release.go | 1 - service/status_serivce.go | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/service/release.go b/service/release.go index e8b03be..169ab21 100644 --- a/service/release.go +++ b/service/release.go @@ -132,7 +132,6 @@ func DownloadRelease(ctx context.Context, release codegen.Release, force bool) ( var mirror string remainingSpace, _ := internal.GetRemainingSpace(config.RAUC_RELEASE_PATH) - logger.Info("remaining space", zap.Uint64("remaining_space", remainingSpace)) packageURL := "" for _, mirror = range release.Mirrors { diff --git a/service/status_serivce.go b/service/status_serivce.go index 42e8b53..b9b24b9 100644 --- a/service/status_serivce.go +++ b/service/status_serivce.go @@ -349,7 +349,9 @@ func (r *StatusService) Cronjob(ctx context.Context, sysRoot string) error { } if releaseFilePath == "" { - logger.Error("release file path is empty") + if shouldUpgrade { + logger.Error("release file path is empty") + } } else { releaseDir := filepath.Dir(releaseFilePath) latestReleaseDir := filepath.Join(filepath.Dir(releaseDir), "latest")