refactor: harden sqlite runtime and packaged startup flow
- refine config loading with --config and current-directory .env - improve sqlite busy handling and runtime DB tuning - restore telegram payment notification and wallet input flow - add behavior-based config and callback recovery tests
This commit is contained in:
+10
-1
@@ -1,6 +1,11 @@
|
||||
package command
|
||||
|
||||
import "github.com/spf13/cobra"
|
||||
import (
|
||||
"github.com/assimon/luuu/config"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var configPath string
|
||||
|
||||
var rootCmd = &cobra.Command{}
|
||||
|
||||
@@ -9,5 +14,9 @@ func Execute() error {
|
||||
}
|
||||
|
||||
func init() {
|
||||
rootCmd.PersistentFlags().StringVar(&configPath, "config", "", "path to .env or directory containing .env")
|
||||
rootCmd.PersistentPreRun = func(cmd *cobra.Command, args []string) {
|
||||
config.SetConfigPath(configPath)
|
||||
}
|
||||
rootCmd.AddCommand(httpCmd)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user