add basic scheduler
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-01-06 22:24:56 +01:00
parent be6403105c
commit ed2e15a3dd
12 changed files with 109 additions and 2 deletions

View File

@@ -5,9 +5,16 @@ import (
"os"
"git.front.kjuulh.io/kjuulh/orbis/internal/app"
"github.com/joho/godotenv"
)
func main() {
err := godotenv.Load()
if err != nil {
fmt.Printf("%s\n", err)
os.Exit(1)
}
app := app.NewApp()
if err := newRoot(app).Execute(); err != nil {

View File

@@ -1,6 +1,8 @@
package main
import (
"fmt"
"git.front.kjuulh.io/kjuulh/orbis/internal/app"
"github.com/spf13/cobra"
)
@@ -13,8 +15,13 @@ func newRoot(app *app.App) *cobra.Command {
Short: "Orbis is a data workflow scheduler for all your batch and real-time needs",
RunE: func(cmd *cobra.Command, args []string) error {
ctx := cmd.Context()
logger.Info("starting orbis")
if err := app.Scheduler().Execute(ctx); err != nil {
return fmt.Errorf("scheduler failed with error: %w", err)
}
return nil
},
}