Commit e94f916e authored by Andrei Mihu's avatar Andrei Mihu
Browse files

Make Go and Lua runtime startup log messages consistent.

parent 1538734f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@ The format is based on [keep a changelog](http://keepachangelog.com) and this pr
- Default maximum database connection lifetime is now 1 hour.
- Improved parsing of client IP and port for incoming requests and socket connections.
- WebSocket sessions no longer log the client IP and port number in error messages.
- Made Go and Lua runtime startup log messages consistent.

### Fixed
- CRON expressions for leaderboard and tournament resets now allow concurrent processing.
+4 −0
Original line number Diff line number Diff line
@@ -1792,6 +1792,8 @@ func NewRuntimeProviderGo(logger, startupLogger *zap.Logger, db *sql.DB, config
	// The baseline context that will be passed to all InitModule calls.
	ctx := NewRuntimeGoContext(context.Background(), env, RuntimeExecutionModeRunOnce, nil, 0, "", "", "", "", "")

	startupLogger.Info("Initialising Go runtime provider", zap.String("path", rootPath))

	modulePaths := make([]string, 0)
	for _, path := range paths {
		if strings.ToLower(filepath.Ext(path)) != ".so" {
@@ -1830,5 +1832,7 @@ func NewRuntimeProviderGo(logger, startupLogger *zap.Logger, db *sql.DB, config
		modulePaths = append(modulePaths, relPath)
	}

	startupLogger.Info("Go runtime modules loaded")

	return modulePaths, initializer.rpc, initializer.beforeRt, initializer.afterRt, initializer.beforeReq, initializer.afterReq, initializer.matchmakerMatched, matchCreateFn, initializer.tournamentEnd, initializer.tournamentReset, initializer.leaderboardReset, nk.SetMatchCreateFn, matchNamesListFn, nil
}
+1 −3
Original line number Diff line number Diff line
@@ -122,7 +122,7 @@ func NewRuntimeProviderLua(logger, startupLogger *zap.Logger, db *sql.DB, jsonpb
		return nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, err
	}

	startupLogger.Info("Initialising Lua runtime provider", zap.String("path", lua.LuaLDir))
	startupLogger.Info("Initialising Lua runtime provider", zap.String("path", rootPath))

	for _, path := range paths {
		if strings.ToLower(filepath.Ext(path)) != ".lua" {
@@ -213,8 +213,6 @@ func NewRuntimeProviderLua(logger, startupLogger *zap.Logger, db *sql.DB, jsonpb
		statsCtx: context.Background(),
	}

	startupLogger.Info("Evaluating Lua runtime modules")

	r, err := newRuntimeLuaVM(logger, db, jsonpbUnmarshaler, config, socialClient, leaderboardCache, leaderboardRankCache, leaderboardScheduler, sessionRegistry, matchRegistry, tracker, streamManager, router, stdLibs, moduleCache, once, localCache, allMatchCreateFn, func(execMode RuntimeExecutionMode, id string) {
		switch execMode {
		case RuntimeExecutionModeRPC: