diff --git a/api/dataimport/internal/converterSelector/selector.go b/api/dataimport/internal/converterSelector/selector.go index 99ad6659..d75a1c12 100644 --- a/api/dataimport/internal/converterSelector/selector.go +++ b/api/dataimport/internal/converterSelector/selector.go @@ -19,6 +19,7 @@ package converterSelector import ( "errors" + "fmt" "path/filepath" "strings" @@ -85,10 +86,12 @@ func SelectDataConverter(localFS fileaccess.FileAccess, remoteFS fileaccess.File } // Log the paths to help us diagnose issues... - log.Infof("SelectDataConverter path listing:") + // Print it in one log message + logMsg := "SelectDataConverter path listing:" for c, item := range items { - log.Infof(" %v. %v", c+1, item) + logMsg += fmt.Sprintf("\n %v. %v\n", c+1, item) } + log.Infof(logMsg) // Unknown return nil, errors.New("Failed to determine dataset type to import.") diff --git a/api/ws/ws.go b/api/ws/ws.go index 7ae3da5c..78031ec5 100644 --- a/api/ws/ws.go +++ b/api/ws/ws.go @@ -36,7 +36,7 @@ func MakeWSHandler(m *melody.Melody, svcs *services.APIServices) *WSHandler { } func (ws *WSHandler) clearOldTokens() { - nowSec := time.Now().Unix() // TODO: use GetTimeNowSec + nowSec := ws.svcs.TimeStamper.GetTimeNowSec() for token, usr := range ws.connectTokens { if usr.expiryUnixSec < nowSec { delete(ws.connectTokens, token) @@ -48,7 +48,7 @@ func (ws *WSHandler) HandleBeginWSConnection(params apiRouter.ApiHandlerGenericP // Generate a token that is valid for a short time token := utils.RandStringBytesMaskImpr(32) - expirySec := time.Now().Unix() + 10 // TODO: use GetTimeNowSec + expirySec := ws.svcs.TimeStamper.GetTimeNowSec() + 10 // Clear out old ones, now is a good a time as any! ws.clearOldTokens() @@ -90,7 +90,7 @@ func (ws *WSHandler) HandleConnect(s *melody.Session) { } if conn, ok := ws.connectTokens[token[0]]; !ok { - fmt.Printf("WS connect failed for INVALID token: %v\n", token) + fmt.Printf("WS connect failed for UNKNOWN token: %v\n", token) s.CloseWithMsg([]byte("Invalid token")) return } else {