blabla im tired
This commit is contained in:
parent
4d6606d392
commit
c0c0f5d000
4 changed files with 19 additions and 10 deletions
6
common/config.go
Normal file
6
common/config.go
Normal file
|
@ -0,0 +1,6 @@
|
|||
package common
|
||||
|
||||
const ArangoHost = "http://host:8529"
|
||||
const ArangoUser = "user"
|
||||
const ArangoPass = "pass"
|
||||
const ArangoDatabase = "db"
|
|
@ -71,7 +71,7 @@ func ConnectDB(baseURL string, arangoUser string, arangoPWD string, arangoDataba
|
|||
return driver, ctx, fmt.Errorf("connectDB: FUCK HOW DID THIS EXCUTE?")
|
||||
}
|
||||
func InitDatabase() (err error) {
|
||||
arangoDB, arangoCTX, err = ConnectDB("http://192.168.45.8:8529/", "gma-inator", "gma-inator", "gma-inator")
|
||||
arangoDB, arangoCTX, err = ConnectDB(common.ArangoHost, common.ArangoUser, common.ArangoPass, common.ArangoDatabase)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -119,7 +119,7 @@ func bla() error {
|
|||
sem := common.NewSemaphore(ConcurrencyLimit)
|
||||
wg := sync.WaitGroup{}
|
||||
|
||||
entries, err := os.ReadDir("/mnt/SC9000/storagePool2/")
|
||||
entries, err := os.ReadDir("/zpool0/cheetah/workshop/garrysmod/gma-inator/chunks/")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -166,14 +166,14 @@ func bla() error {
|
|||
DoneTaskCount <- 1
|
||||
}()
|
||||
//fmt.Printf("Scanning For Local Pools, found %s:", job)
|
||||
tarFinalPath := filepath.Join("/mnt/SC9000/storagePool2/", job)
|
||||
tarFinalPath := filepath.Join("/zpool0/cheetah/workshop/garrysmod/gma-inator/chunks/", job)
|
||||
_, err = os.Stat(tarFinalPath)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
return err
|
||||
}
|
||||
parts := strings.Split(job, ".")
|
||||
jsonPath := filepath.Join("/mnt/SC9000/storagePool2/", fmt.Sprintf("%s.json", parts[0]))
|
||||
jsonPath := filepath.Join("/zpool0/cheetah/workshop/garrysmod/gma-inator/chunks/", fmt.Sprintf("%s.json", parts[0]))
|
||||
_, err = os.Stat(jsonPath)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
|
|
7
main.go
7
main.go
|
@ -87,7 +87,7 @@ func ConnectDB(baseURL string, arangoUser string, arangoPWD string, arangoDataba
|
|||
return driver, ctx, fmt.Errorf("connectDB: FUCK HOW DID THIS EXCUTE?")
|
||||
}
|
||||
func InitDatabase() (err error) {
|
||||
arangoDB, arangoCTX, err = ConnectDB("http://192.168.45.8:8529/", "gma-inator", "gma-inator", "gma-inator")
|
||||
arangoDB, arangoCTX, err = ConnectDB(common.ArangoHost, common.ArangoUser, common.ArangoPass, common.ArangoDatabase)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -410,6 +410,9 @@ func modeIngress(folderPath string, skipN int) {
|
|||
err = ProcessGMA(pw, jobFile)
|
||||
if err != nil {
|
||||
pw.Log(fmt.Sprintf("\nERROR: %v\n", err))
|
||||
if strings.Contains(err.Error(), "refused") {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
}(jobFile, &wg)
|
||||
|
@ -933,7 +936,7 @@ func ProcessGMA(pw progress.Writer, filePath string) (err error) {
|
|||
return err
|
||||
}
|
||||
|
||||
recoveryPath := filepath.Join("/mnt/SC9000/gmaRecovery", fmt.Sprintf("%s.json", dboGMA.OriginalPath))
|
||||
recoveryPath := filepath.Join("/zpool0/cheetah/workshop/garrysmod/gma-inator/recovery-tree", fmt.Sprintf("%s.json", dboGMA.OriginalPath))
|
||||
err = os.MkdirAll(filepath.Dir(recoveryPath), os.ModePerm)
|
||||
if err != nil {
|
||||
undoBatch(true, dboGMA.ID, fileIDs, gma2FileIDs)
|
||||
|
|
|
@ -30,12 +30,12 @@ import (
|
|||
|
||||
var (
|
||||
FastCacheEnabled = true
|
||||
FastCachePath = "/mnt/SC9000/fastCache2"
|
||||
FastCachePath = "/zpool0/cheetah/workshop/garrysmod/gma-inator/cache"
|
||||
WORMCachePath = FastCachePath
|
||||
|
||||
PoolMaxItems = 500
|
||||
PoolPathFinal = "/mnt/SC9000/storagePool2"
|
||||
PoolPathTemp = "/mnt/ramfs/"
|
||||
PoolPathFinal = "/zpool0/cheetah/workshop/garrysmod/gma-inator/chunks/"
|
||||
PoolPathTemp = "/zpool0/cheetah/workshop/garrysmod/gma-inator/temp"
|
||||
)
|
||||
|
||||
// TODO: write Recovery Data after Packing
|
||||
|
@ -146,7 +146,7 @@ func ConnectDB(baseURL string, arangoUser string, arangoPWD string, arangoDataba
|
|||
return driver, ctx, fmt.Errorf("connectDB: FUCK HOW DID THIS EXCUTE?")
|
||||
}
|
||||
func InitDatabase() (err error) {
|
||||
arangoDB, arangoCTX, err = ConnectDB("http://192.168.45.8:8529/", "gma-inator", "gma-inator", "gma-inator")
|
||||
arangoDB, arangoCTX, err = ConnectDB("http://192.168.133.6:8529", "gma-inator", "gma-inator", "gma-inator")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue