X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/9eafed4c378012e914000658b30af4f8a1c51432..c6df16d2af30e989bcfb04f6ef730cde658a9dc9:/services/crunch-run/upload.go diff --git a/services/crunch-run/upload.go b/services/crunch-run/upload.go index 3285fccb76..a068a2a77b 100644 --- a/services/crunch-run/upload.go +++ b/services/crunch-run/upload.go @@ -103,7 +103,7 @@ func (m *CollectionFileWriter) goUpload() { finish <- errors } -// CollectionWriter makes implements creating new Keep collections by opening files +// CollectionWriter implements creating new Keep collections by opening files // and writing to them. type CollectionWriter struct { IKeepClient @@ -187,6 +187,9 @@ func (m *CollectionWriter) ManifestText() (mt string, err error) { m.mtx.Lock() defer m.mtx.Unlock() for _, v := range m.Streams { + if len(v.FileStreamSegments) == 0 { + continue + } k := v.StreamName if k == "." { buf.WriteString(".") @@ -195,9 +198,13 @@ func (m *CollectionWriter) ManifestText() (mt string, err error) { k = strings.Replace(k, "\n", "", -1) buf.WriteString("./" + k) } - for _, b := range v.Blocks { - buf.WriteString(" ") - buf.WriteString(b) + if len(v.Blocks) > 0 { + for _, b := range v.Blocks { + buf.WriteString(" ") + buf.WriteString(b) + } + } else { + buf.WriteString(" d41d8cd98f00b204e9800998ecf8427e+0") } for _, f := range v.FileStreamSegments { buf.WriteString(" ")