Panic in indexer manifest creation

This is the error message I get:

panic: runtime error: index out of range [8] with length 8

goroutine 109 [running]:
gitlab.gwdg.de/subugoe/metsimporter/indexer/export.CreateIiifManifest(0x0?)
	/go/src/api/export/iiif.go:99 +0x8e47
created by main.main in goroutine 1
	/go/src/api/indexer.go:129 +0x605

This is the code in iiif.go:

if elapsed := time.Since(manifestData.Time); elapsed < (time.Second * time.Duration(intervals[manifestData.Attempts])) {

Apparently manifestData.Attempts is greater than 7 which causes the error because intervals has only 8 elements, so that indexes greater 7 will panic.

Edited by Jonas Schrewe