mirror of
https://github.com/metabarcoding/obitools4.git
synced 2025-12-08 16:50:27 +00:00
Add capacity to obidistribute to save gzipped files
This commit is contained in:
@@ -2,6 +2,7 @@ package obiformats
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
log "github.com/sirupsen/logrus"
|
||||
@@ -22,6 +23,7 @@ func WriterDispatcher(prototypename string,
|
||||
jobDone.Add(1)
|
||||
|
||||
go func() {
|
||||
opt := MakeOptions(options)
|
||||
for newflux := range dispatcher.News() {
|
||||
jobDone.Add(1)
|
||||
go func(newflux int) {
|
||||
@@ -31,8 +33,13 @@ func WriterDispatcher(prototypename string,
|
||||
log.Fatalf("Cannot retreive the new chanel : %v", err)
|
||||
}
|
||||
|
||||
name:=fmt.Sprintf(prototypename, dispatcher.Classifier().Value(newflux))
|
||||
if opt.CompressedFile() && ! strings.HasSuffix(name,".gz") {
|
||||
name = name + ".gz"
|
||||
}
|
||||
|
||||
out, err := formater(data,
|
||||
fmt.Sprintf(prototypename, dispatcher.Classifier().Value(newflux)),
|
||||
name,
|
||||
options...)
|
||||
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user