Skip to content

Commit

Permalink
better logging for task end time
Browse files Browse the repository at this point in the history
  • Loading branch information
sonroyaalmerol committed Nov 17, 2024
1 parent ca7d180 commit 81b4e35
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions internal/store/tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,12 @@ func (storeInstance *Store) GetTaskEndTime(task *Task) (int64, error) {
parsed := upidSplit[3]
logFolder := parsed[len(parsed)-2:]

logStat, err := os.Stat(fmt.Sprintf("/var/log/proxmox-backup/tasks/%s/%s", logFolder, task.UPID))
logPath := fmt.Sprintf("/var/log/proxmox-backup/tasks/%s/%s", logFolder, task.UPID)

logStat, err := os.Stat(logPath)
if err == nil {
return logStat.ModTime().Unix(), nil
}

return -1, fmt.Errorf("GetTaskEndTime: error getting tasks: not found")
return -1, fmt.Errorf("GetTaskEndTime: error getting tasks: not found (%s) -> %w", logPath, err)
}

0 comments on commit 81b4e35

Please sign in to comment.