From c5129d704557bae946998d2e426d53c56bf0128d Mon Sep 17 00:00:00 2001 From: David Schmitt Date: Tue, 22 Aug 2023 14:20:50 +0200 Subject: [PATCH 1/2] Fix create-bookmark output to stdout --- cmd/createbookmark.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/createbookmark.go b/cmd/createbookmark.go index f97e820b..24209ff1 100644 --- a/cmd/createbookmark.go +++ b/cmd/createbookmark.go @@ -122,7 +122,7 @@ func CreateBookmark(signals chan os.Signal, ready chan bool) int { if err != nil { log.Infof("Error rendering bookmark: %v", err) } else { - log.Info(string(b)) + fmt.Println(string(b)) } return 0 From 3b22f423da6b339abce2f30c1893538ee02a10ad Mon Sep 17 00:00:00 2001 From: David Schmitt Date: Tue, 22 Aug 2023 14:21:09 +0200 Subject: [PATCH 2/2] Implement request --ignore-cache --- cmd/request.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cmd/request.go b/cmd/request.go index d770f5cc..26ab5f34 100644 --- a/cmd/request.go +++ b/cmd/request.go @@ -91,6 +91,7 @@ func Request(signals chan os.Signal, ready chan bool) int { // nolint: bodyclose // nhooyr.io/websocket reads the body internally c, _, err := websocket.Dial(ctx, gatewayUrl, options) if err != nil { + lf["gateway-url"] = gatewayUrl log.WithContext(ctx).WithFields(lf).WithError(err).Error("Failed to connect to overmind API") return 1 } @@ -342,8 +343,9 @@ func createInitialRequest() (*sdp.GatewayRequest, error) { msgID := uuid.New() req.RequestType = &sdp.GatewayRequest_LoadBookmark{ LoadBookmark: &sdp.LoadBookmark{ - UUID: bookmarkUUID[:], - MsgID: msgID[:], + UUID: bookmarkUUID[:], + MsgID: msgID[:], + IgnoreCache: viper.GetBool("ignore-cache"), }, } case "load-snapshot": @@ -374,6 +376,7 @@ func init() { requestCmd.PersistentFlags().String("query-type", "*", "The type to query") requestCmd.PersistentFlags().String("query", "", "The actual query to send") requestCmd.PersistentFlags().String("query-scope", "*", "The scope to query") + requestCmd.PersistentFlags().Bool("ignore-cache", false, "Set to true to ignore all caches in overmind.") requestCmd.PersistentFlags().String("bookmark-uuid", "", "The UUID of the bookmark to load") requestCmd.PersistentFlags().String("snapshot-uuid", "", "The UUID of the snapshot to load")