Skip to content
Snippets Groups Projects
Commit b8186444 authored by Bastien DUMONT's avatar Bastien DUMONT :angel:
Browse files

chore: fix get GRDF access token

parent 0fa41214
No related branches found
No related tags found
1 merge request!108chore(release): Ecolyo 3.1.0
Pipeline #105754 passed
......@@ -39,25 +39,25 @@ func main() {
mockOAuth2Port := ":8090"
go http.ListenAndServe(mockOAuth2Port, mocks.CreateMockOAuth2())
fmt.Println("Mock OAuth2 server Listening on: http://localhost" + mockOAuth2Port)
}
// Call the function immediately when the server starts
models.FetchGRDFAuthAPI()
// Call the function immediately when the server starts
models.FetchGRDFAuthAPI()
// then call GRDF auth api every two hours
ticker := time.NewTicker(time.Hour * 2)
quit := make(chan struct{})
go func() {
for {
select {
case <-ticker.C:
models.FetchGRDFAuthAPI()
case <-quit:
ticker.Stop()
return
}
// then call GRDF auth api every two hours
ticker := time.NewTicker(time.Hour * 2)
quit := make(chan struct{})
go func() {
for {
select {
case <-ticker.C:
models.FetchGRDFAuthAPI()
case <-quit:
ticker.Stop()
return
}
}()
}
}
}()
// Serve locally with https
log.Fatal(http.ListenAndServeTLS(":"+strconv.Itoa(httpsPort), "./dev_certificates/localhost.crt", "./dev_certificates/localhost.key", rootMux.Router))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment