Skip to content

Commit

Permalink
improve time-to-live formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristy committed Feb 8, 2024
1 parent 7d49c7d commit aecf7ab
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions MagickCache/magick-cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -1770,10 +1770,12 @@ MagickExport MagickBooleanType IdentifyMagickCacheResource(MagickCache *cache,
expired=' ';
if ((resource->ttl != 0) && ((resource->timestamp+resource->ttl) < time(0)))
expired='*';
(void) fprintf(file,"%s%s %s %g:%g:%g:%g%c %s\n",GetMagickCacheResourceIRI(
resource),size,extent,(double) (resource->ttl/(3600*24)),(double)
((resource->ttl % (24*3600))/3600),(double) ((resource->ttl % 3600)/60),
(double) ((resource->ttl % 3600) % 60),expired,iso8601);
(void) fprintf(file,"%s%s %s %g:%02g:%02g:%02g%c %s\n",
GetMagickCacheResourceIRI(resource),size,extent,
ceil((double) (resource->ttl/(3600*24))),
ceil((double) ((resource->ttl % (24*3600))/3600)),
ceil((double) ((resource->ttl % 3600)/60)),
ceil((double) ((resource->ttl % 3600) % 60)),expired,iso8601);
path=DestroyString(path);
return(status);
}
Expand Down

0 comments on commit aecf7ab

Please sign in to comment.