-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathload.go
More file actions
30 lines (24 loc) · 682 Bytes
/
load.go
File metadata and controls
30 lines (24 loc) · 682 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package main
import (
"os"
"strings"
log "github.com/sirupsen/logrus"
"github.com/spf13/viper"
)
func loadFile(file string) {
defer SWG.Done()
switch viper.GetString("load." + getFileNameNoExt(file) + ".db") {
case "oracle":
err := loadToOracle(file)
if err != nil {
log.Error("Load Oracle error: ", err.Error())
return
}
}
if err := os.Remove(file); err != nil {
log.Error("Errors in deleting the parsed file: ", err.Error())
}
if err := os.Remove(strings.Replace(file, Config.CustomFileExtention.ParsedFileExt, Config.CustomFileExtention.OracleControlFileExt, -1)); err != nil {
log.Error("Errors in deleting the parsed file: ", err.Error())
}
}