hopefully fix time comparison
All checks were successful
ci/woodpecker/pr/pr Pipeline was successful

This commit is contained in:
2024-02-04 00:08:43 +01:00
parent d4357767f5
commit cb1a931b4c
2 changed files with 6 additions and 6 deletions

View File

@ -175,11 +175,11 @@ func RefreshNodeInfo(cfg *config.Config, serverID int) (*hcloud.Server, error) {
return server, nil
}
func CheckRuntime(cfg *config.Config, server *hcloud.Server) (time.Duration, error) {
func CheckRuntime(cfg *config.Config, server *hcloud.Server) (time.Time, error) {
server, err := RefreshNodeInfo(cfg, server.ID)
now := time.Now()
if err != nil {
return time.Duration(0), errors.New(fmt.Sprintf("Could not check Runtime: %s", err.Error()))
return time.Time{}, errors.New(fmt.Sprintf("Could not check Runtime: %s", err.Error()))
}
return server.Created.Sub(now), nil
return server.Created.Add(time.Duration(now.Minute())), nil
}