Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var SearchCmd = &cobra.Command{ Use: "search [sync|delete]", Short: "Sync or delete repositories and developers in full text search", Args: cobra.ExactArgs(1), Run: func(cmd *cobra.Command, args []string) { action := args[0] config.Init() ctx, stop := context.WithCancel(context.Background()) db := database.GetInstance(ctx) handler := search.NewSearchHandler(db, search.NewSearch()) defer func() { err := db.Close() if err != nil { slog.Error("failed to close db", slog.Any("error", err)) sentry.CaptureException(err) } stop() sentry.Flush(2 * time.Second) }() appSignal := make(chan os.Signal, 3) signal.Notify(appSignal, os.Interrupt, syscall.SIGTERM) go func() { <-appSignal stop() }() err := handler.Handle(ctx, action) if err != nil { slog.Error("failed to handle action", slog.Any("error", err)) sentry.CaptureException(err) } }, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.