From 4ef556decfa991f497d28131b81d23a50d989672 Mon Sep 17 00:00:00 2001 From: Aditya <60684641+0x0elliot@users.noreply.github.com> Date: Mon, 28 Aug 2023 17:12:08 +0530 Subject: [PATCH 1/2] fix: removing annoying hardcoded strings --- db-connector.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/db-connector.go b/db-connector.go index 18b7204..bac4f43 100755 --- a/db-connector.go +++ b/db-connector.go @@ -7939,6 +7939,11 @@ func RunInit(dbclient datastore.Client, storageClient storage.Client, gceProject dbType = "opensearch" } + cloudRunUrl := os.Getenv("SHUFFLE_CLOUDRUN_URL") + if cloudRunUrl == "" { + cloudRunUrl = "https://shuffler.io" + } + project = ShuffleStorage{ Dbclient: dbclient, StorageClient: storageClient, @@ -7946,14 +7951,14 @@ func RunInit(dbclient datastore.Client, storageClient storage.Client, gceProject Environment: environment, CacheDb: cacheDb, DbType: dbType, - CloudUrl: "https://shuffler.io", + CloudUrl: cloudRunUrl, BucketName: "shuffler.appspot.com", } bucketName := os.Getenv("SHUFFLE_ORG_BUCKET") if len(bucketName) > 0 { log.Printf("[DEBUG] Using custom project bucketname: %s", bucketName) - project.BucketName = bucketName + BucketName = bucketName } // docker run -p 11211:11211 --name memcache -d memcached -m 100 From 8ff78b84494747f89583d6bc9c3b1aeab42d2ffb Mon Sep 17 00:00:00 2001 From: Aditya <60684641+0x0elliot@users.noreply.github.com> Date: Mon, 28 Aug 2023 17:54:01 +0530 Subject: [PATCH 2/2] fix: removing typo from my end --- db-connector.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db-connector.go b/db-connector.go index bac4f43..334e6c4 100755 --- a/db-connector.go +++ b/db-connector.go @@ -7958,7 +7958,7 @@ func RunInit(dbclient datastore.Client, storageClient storage.Client, gceProject bucketName := os.Getenv("SHUFFLE_ORG_BUCKET") if len(bucketName) > 0 { log.Printf("[DEBUG] Using custom project bucketname: %s", bucketName) - BucketName = bucketName + project.BucketName = bucketName } // docker run -p 11211:11211 --name memcache -d memcached -m 100