|
|
@ -39,7 +39,7 @@ func ConnectDB(baseURL string, arangoUser string, arangoPWD string, arangoDataba
|
|
|
|
// Retry Loop for Failed Connections
|
|
|
|
// Retry Loop for Failed Connections
|
|
|
|
for i := 0; i < 6; i++ {
|
|
|
|
for i := 0; i < 6; i++ {
|
|
|
|
if i == 5 {
|
|
|
|
if i == 5 {
|
|
|
|
return driver, ctx, fmt.Errorf("connectdb unable to connect to database %d times!", i)
|
|
|
|
return driver, ctx, fmt.Errorf("connectdb unable to connect to database %d times", i)
|
|
|
|
} else if i > 0 {
|
|
|
|
} else if i > 0 {
|
|
|
|
time.Sleep(30 * time.Second)
|
|
|
|
time.Sleep(30 * time.Second)
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -79,7 +79,9 @@ func ConnectDB(baseURL string, arangoUser string, arangoPWD string, arangoDataba
|
|
|
|
}
|
|
|
|
}
|
|
|
|
func InitDatabase() (err error) {
|
|
|
|
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.45.8:8529/", "gma-inator", "gma-inator", "gma-inator")
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
return err
|
|
|
|
|
|
|
|
}
|
|
|
|
/*colChunk, err = arangoDB.Collection(arangoCTX, "chunk")
|
|
|
|
/*colChunk, err = arangoDB.Collection(arangoCTX, "chunk")
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
return err
|
|
|
@ -152,7 +154,7 @@ func main() {
|
|
|
|
var WorkerJobPool []string
|
|
|
|
var WorkerJobPool []string
|
|
|
|
|
|
|
|
|
|
|
|
for _, e := range entries {
|
|
|
|
for _, e := range entries {
|
|
|
|
if !e.IsDir() && skipBla == true {
|
|
|
|
if !e.IsDir() && skipBla {
|
|
|
|
if e.Name() == "2547463094.1626322945.gma" {
|
|
|
|
if e.Name() == "2547463094.1626322945.gma" {
|
|
|
|
skipBla = false
|
|
|
|
skipBla = false
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
@ -273,7 +275,7 @@ func ProcessGMA(filePath string) (err error) {
|
|
|
|
dboFiles []common.DB_File
|
|
|
|
dboFiles []common.DB_File
|
|
|
|
)
|
|
|
|
)
|
|
|
|
for _, file := range files {
|
|
|
|
for _, file := range files {
|
|
|
|
fmt.Printf("%s CRC: %d Offset: %d Size: %d NextType: %d FileNumber: %d\n", file.FileName, file.CRC, file.Offset, file.FileSize, file.NextType, file.FileNumber)
|
|
|
|
//fmt.Printf("%s CRC: %d Offset: %d Size: %d NextType: %d FileNumber: %d\n", file.FileName, file.CRC, file.Offset, file.FileSize, file.NextType, file.FileNumber)
|
|
|
|
if file.NextType > uint32(file.FileNumber+10) { // Something is fucked
|
|
|
|
if file.NextType > uint32(file.FileNumber+10) { // Something is fucked
|
|
|
|
fmt.Printf("Current Cursor %d", gmaReader.GetOffset())
|
|
|
|
fmt.Printf("Current Cursor %d", gmaReader.GetOffset())
|
|
|
|
for _, otherFile := range files[file.FileNumber:] {
|
|
|
|
for _, otherFile := range files[file.FileNumber:] {
|
|
|
@ -495,7 +497,7 @@ func ProcessGMA(filePath string) (err error) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
for _, dboGMA2File := range dboGMA2Files {
|
|
|
|
for _, dboGMA2File := range dboGMA2Files {
|
|
|
|
fmt.Printf("WriteFile for %s number %d = %s\n", dboGMA2File.FileName, dboGMA2File.FileNumber, dboGMA2File.UploadID)
|
|
|
|
//fmt.Printf("WriteFile for %s number %d = %s\n", dboGMA2File.FileName, dboGMA2File.FileNumber, dboGMA2File.UploadID)
|
|
|
|
resp, err := httpClient.Get(fmt.Sprintf("http://127.0.0.1:13371/fetch/%s", dboGMA2File.UploadID))
|
|
|
|
resp, err := httpClient.Get(fmt.Sprintf("http://127.0.0.1:13371/fetch/%s", dboGMA2File.UploadID))
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
undoBatch(true, dboGMA.ID, fileIDs, gma2FileIDs)
|
|
|
|
undoBatch(true, dboGMA.ID, fileIDs, gma2FileIDs)
|
|
|
|