mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-21 17:21:09 +01:00
- Introduced a new utility function to print a logo and welcome information for the Crawlab server, enhancing user experience during startup. - Updated logger variable names in the apps package for consistency and clarity. - Added a new dependency on github.com/common-nighthawk/go-figure to facilitate logo rendering. - Improved the server command to display the logo when the server starts, provided the user is not using the pro version.
28 lines
443 B
Go
28 lines
443 B
Go
package apps
|
|
|
|
import (
|
|
"github.com/crawlab-team/crawlab/core/utils"
|
|
)
|
|
|
|
var logger = utils.NewLogger("Apps")
|
|
|
|
func Start(app App) {
|
|
start(app)
|
|
}
|
|
|
|
func start(app App) {
|
|
app.Init()
|
|
go app.Start()
|
|
app.Wait()
|
|
app.Stop()
|
|
}
|
|
|
|
func initModule(name string, fn func() error) (err error) {
|
|
if err := fn(); err != nil {
|
|
logger.Errorf("init %s error: %v", name, err)
|
|
panic(err)
|
|
}
|
|
logger.Infof("initialized %s successfully", name)
|
|
return nil
|
|
}
|