Fix: get execute file path dynamically

This commit is contained in:
HFO4
2020-03-11 10:32:35 +08:00
parent b6e1e04ce0
commit 4d70f9fa3e
12 changed files with 27 additions and 16 deletions

View File

@@ -78,7 +78,7 @@ func (fs *FileSystem) Compress(ctx context.Context, folderIDs, fileIDs []uint, i
saveFolder = "compress"
}
zipFilePath := filepath.Join(
model.GetSettingByName("temp_path"),
util.RelativePath(model.GetSettingByName("temp_path")),
saveFolder,
fmt.Sprintf("archive_%d.zip", time.Now().UnixNano()),
)
@@ -217,7 +217,7 @@ func (fs *FileSystem) Decompress(ctx context.Context, src, dst string) error {
}
tempZipFilePath = filepath.Join(
model.GetSettingByName("temp_path"),
util.RelativePath(model.GetSettingByName("temp_path")),
"decompress",
fmt.Sprintf("archive_%d.zip", time.Now().UnixNano()),
)
@@ -291,8 +291,8 @@ func (fs *FileSystem) Decompress(ctx context.Context, src, dst string) error {
select {
case <-worker:
wg.Add(1)
go func(fileStream io.ReadCloser, size int64) {
wg.Add(1)
defer func() {
worker <- 1
wg.Done()