diff --git a/src/go/storage/storage.go b/src/go/storage/storage.go index ab87d75..3fdaa61 100644 --- a/src/go/storage/storage.go +++ b/src/go/storage/storage.go @@ -4,13 +4,15 @@ import ( "context" "encoding/json" "fmt" + "io/ioutil" + "os" + "strings" + "time" + "github.com/go-redis/redis/v7" "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo/options" - "io/ioutil" - "strings" - "time" ) // RedisClient the Redis client @@ -81,12 +83,14 @@ func handler(config ConfigStruct) { HandleError(err, 0) for cur.Next(context.TODO()) { - go checkAccountSizeAndUpdate(cur.Current.Lookup("username").String(), cur.Current.Lookup("id").String()) + checkAccountSizeAndUpdate(cur.Current.Lookup("username").String(), cur.Current.Lookup("id").String()) fmt.Printf("Checking account information for %s\n", cur.Current.Lookup("username").String()) - time.Sleep(600000 * time.Millisecond) + time.Sleep(300000 * time.Millisecond) } err = mongoClient.Disconnect(ctx) HandleError(err, 1) + fmt.Println("CSD-GO-STR finished, exiting with code 0. [GO]") + os.Exit(0) } func checkAccountSizeAndUpdate(username string, id string) {