all repos — homestead @ ee0b56f1dd376a5f9756bad6a6190d888137534f

Code for my website

fetch calendar if zero-bytes

Alan Pearce
commit

ee0b56f1dd376a5f9756bad6a6190d888137534f

parent

cd337b3c3f4110de1d1630bae66b812f8fef0e1b

1 file changed, 1 insertion(+), 1 deletion(-)

changed files
M internal/calendar/calendar.gointernal/calendar/calendar.go
@@ -69,7 +69,7 @@ if err != nil && !errors.Is(err, fs.ErrNotExist) {
return errors.WithMessage(err, "could not stat calendar file") } - if stat == nil || time.Since(stat.ModTime()) > Refresh { + if stat == nil || time.Since(stat.ModTime()) > Refresh || stat.Size() == 0 { err := c.fetch(ctx) if err != nil { return err