suppress the error message after it has shown once

This commit is contained in:
sawka 2024-08-29 18:08:05 -07:00
parent 53d3ad04b7
commit 6e704f74e3
2 changed files with 6 additions and 3 deletions

View File

@ -14,7 +14,6 @@ import (
"github.com/wavetermdev/thenextwave/pkg/wshrpc" "github.com/wavetermdev/thenextwave/pkg/wshrpc"
) )
var viewNewBlock bool
var viewMagnified bool var viewMagnified bool
var viewCmd = &cobra.Command{ var viewCmd = &cobra.Command{
@ -26,7 +25,6 @@ var viewCmd = &cobra.Command{
} }
func init() { func init() {
viewCmd.Flags().BoolVarP(&viewNewBlock, "newblock", "n", false, "open view in a new block")
viewCmd.Flags().BoolVarP(&viewMagnified, "magnified", "m", false, "open view in magnified mode") viewCmd.Flags().BoolVarP(&viewMagnified, "magnified", "m", false, "open view in magnified mode")
rootCmd.AddCommand(viewCmd) rootCmd.AddCommand(viewCmd)
} }

View File

@ -91,6 +91,8 @@ function sendRawRpcMessage(msg: RpcMessage) {
globalWS.pushMessage(wsMsg); globalWS.pushMessage(wsMsg);
} }
const notFoundLogMap = new Map<string, boolean>();
function handleIncomingRpcMessage(msg: RpcMessage, eventHandlerFn: (event: WaveEvent) => void) { function handleIncomingRpcMessage(msg: RpcMessage, eventHandlerFn: (event: WaveEvent) => void) {
const isRequest = msg.command != null || msg.reqid != null; const isRequest = msg.command != null || msg.reqid != null;
if (isRequest) { if (isRequest) {
@ -111,7 +113,10 @@ function handleIncomingRpcMessage(msg: RpcMessage, eventHandlerFn: (event: WaveE
} }
const entry = openRpcs.get(msg.resid); const entry = openRpcs.get(msg.resid);
if (entry == null) { if (entry == null) {
console.log("rpc response generator not found", msg); if (!notFoundLogMap.has(msg.resid)) {
notFoundLogMap.set(msg.resid, true);
console.log("rpc response generator not found", msg);
}
return; return;
} }
entry.msgFn(msg); entry.msgFn(msg);