From 2ef228a1929bc42c55de05816d5040d06f436f27 Mon Sep 17 00:00:00 2001 From: Fred Boniface Date: Fri, 22 Nov 2024 21:38:53 +0000 Subject: [PATCH] Enable writing of PIS Metadata --- dbAccess/client.go | 2 +- helpers/config.go | 2 +- pis/check.go | 5 +++++ pis/update.go | 3 +-- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/dbAccess/client.go b/dbAccess/client.go index 6c182aa..7e7e84f 100644 --- a/dbAccess/client.go +++ b/dbAccess/client.go @@ -17,7 +17,7 @@ var MongoClient (*mongo.Client) // Builds the DB URI based on the loaded configuration parameters func getDbUri(cfg *helpers.Configuration) string { - var uri = "mongodb://" + cfg.DbUser + ":" + cfg.DbPass + "@" + cfg.DbHost + ":" + cfg.DbPort + "?authSource=owlboard" + var uri = "mongodb://" + cfg.DbUser + ":" + cfg.DbPass + "@" + cfg.DbHost + ":" + cfg.DbPort + "/?authSource=owlboard" return uri } diff --git a/helpers/config.go b/helpers/config.go index 039ea6f..24be168 100644 --- a/helpers/config.go +++ b/helpers/config.go @@ -5,7 +5,7 @@ import ( ) // Version Constants -const versionNum string = "2024.11.5" +const versionNum string = "2024.11.6" const versionSuffix string = "" const Version string = versionNum + versionSuffix diff --git a/pis/check.go b/pis/check.go index 2978cc7..b0f2cfe 100644 --- a/pis/check.go +++ b/pis/check.go @@ -67,4 +67,9 @@ func Check() { if err != nil { log.Error("Error updating PIS Data", zap.Error(err)) } + + err = dbAccess.PutPisMetadata(apiResp.Name) + if err != nil { + log.Error("Error updating PIS Metadata", zap.Error(err)) + } } diff --git a/pis/update.go b/pis/update.go index 93ef5ff..04a4915 100644 --- a/pis/update.go +++ b/pis/update.go @@ -54,8 +54,7 @@ func runUpdate(tarballUrl string) error { } log.Info("Loaded PIS Files to Slice") - // Temporarily use "pis_testing" collection to ensure all works as expected - err = dbAccess.DropCollection("pis_testing") + err = dbAccess.DropCollection(dbAccess.PisCollection) if err != nil { return err }