pin-reset #139
@ -131,7 +131,7 @@ func main() {
 | 
			
		||||
		os.Exit(1)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	lhs, err := handlers.NewLocalHandlerService(pfp, true, dbResource, cfg, rs)
 | 
			
		||||
	lhs, err := handlers.NewLocalHandlerService(ctx,pfp, true, dbResource, cfg, rs)
 | 
			
		||||
	lhs.SetDataStore(&userdataStore)
 | 
			
		||||
 | 
			
		||||
	if err != nil {
 | 
			
		||||
@ -139,6 +139,12 @@ func main() {
 | 
			
		||||
		os.Exit(1)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	err = lhs.AdminStore.Seed()
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		fmt.Fprintf(os.Stderr, err.Error())
 | 
			
		||||
		os.Exit(1)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	accountService := server.AccountService{}
 | 
			
		||||
	hl, err := lhs.GetHandler(&accountService)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
 | 
			
		||||
@ -104,8 +104,15 @@ func main() {
 | 
			
		||||
		os.Exit(1)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	lhs, err := handlers.NewLocalHandlerService(pfp, true, dbResource, cfg, rs)
 | 
			
		||||
	lhs, err := handlers.NewLocalHandlerService(ctx, pfp, true, dbResource, cfg, rs)
 | 
			
		||||
	lhs.SetDataStore(&userdataStore)
 | 
			
		||||
 | 
			
		||||
	err = lhs.AdminStore.Seed()
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		fmt.Fprintf(os.Stderr, err.Error())
 | 
			
		||||
		os.Exit(1)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	accountService := server.AccountService{}
 | 
			
		||||
 | 
			
		||||
	hl, err := lhs.GetHandler(&accountService)
 | 
			
		||||
 | 
			
		||||
@ -92,13 +92,20 @@ func main() {
 | 
			
		||||
		os.Exit(1)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	lhs, err := handlers.NewLocalHandlerService(pfp, true, dbResource, cfg, rs)
 | 
			
		||||
	lhs, err := handlers.NewLocalHandlerService(ctx,pfp, true, dbResource, cfg, rs)
 | 
			
		||||
	lhs.SetDataStore(&userdataStore)
 | 
			
		||||
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		fmt.Fprintf(os.Stderr, err.Error())
 | 
			
		||||
		os.Exit(1)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	err = lhs.AdminStore.Seed()
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		fmt.Fprintf(os.Stderr, err.Error())
 | 
			
		||||
		os.Exit(1)
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	accountService := server.AccountService{}
 | 
			
		||||
	hl, err := lhs.GetHandler(&accountService)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										13
									
								
								cmd/main.go
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								cmd/main.go
									
									
									
									
									
								
							@ -15,7 +15,6 @@ import (
 | 
			
		||||
	"git.grassecon.net/urdt/ussd/internal/handlers"
 | 
			
		||||
	"git.grassecon.net/urdt/ussd/internal/handlers/server"
 | 
			
		||||
	"git.grassecon.net/urdt/ussd/internal/storage"
 | 
			
		||||
	"git.grassecon.net/urdt/ussd/internal/utils"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
var (
 | 
			
		||||
@ -49,9 +48,6 @@ func main() {
 | 
			
		||||
	ctx = context.WithValue(ctx, "Database", database)
 | 
			
		||||
	pfp := path.Join(scriptDir, "pp.csv")
 | 
			
		||||
 | 
			
		||||
	as, _ := utils.NewAdminStore(ctx, "admin_numbers")
 | 
			
		||||
	as.Seed()
 | 
			
		||||
 | 
			
		||||
	cfg := engine.Config{
 | 
			
		||||
		Root:       "root",
 | 
			
		||||
| 
					
	
	
	
	
	
	
	
	 | 
			||||
		SessionId:  sessionId,
 | 
			
		||||
@ -92,9 +88,8 @@ func main() {
 | 
			
		||||
		os.Exit(1)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	lhs, err := handlers.NewLocalHandlerService(pfp, true, dbResource, cfg, rs)
 | 
			
		||||
	lhs, err := handlers.NewLocalHandlerService(ctx, pfp, true, dbResource, cfg, rs)
 | 
			
		||||
	lhs.SetDataStore(&userdatastore)
 | 
			
		||||
	lhs.SetAdminStore(as)
 | 
			
		||||
	lhs.SetPersister(pe)
 | 
			
		||||
 | 
			
		||||
	if err != nil {
 | 
			
		||||
@ -102,6 +97,12 @@ func main() {
 | 
			
		||||
		os.Exit(1)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	err = lhs.AdminStore.Seed()
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		fmt.Fprintf(os.Stderr, err.Error())
 | 
			
		||||
		os.Exit(1)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	accountService := server.AccountService{}
 | 
			
		||||
	hl, err := lhs.GetHandler(&accountService)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	
We are going to need all executables. Should this be instantiated somewhere else, since the path is known?
Sure,we can define it in the LocalHandlerService , then instantiate it in the NewHandlerService,consider:
12825ae08a,will this work?