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() { ...@@ -39,25 +39,25 @@ func main() {
mockOAuth2Port := ":8090" mockOAuth2Port := ":8090"
go http.ListenAndServe(mockOAuth2Port, mocks.CreateMockOAuth2()) go http.ListenAndServe(mockOAuth2Port, mocks.CreateMockOAuth2())
fmt.Println("Mock OAuth2 server Listening on: http://localhost" + mockOAuth2Port) fmt.Println("Mock OAuth2 server Listening on: http://localhost" + mockOAuth2Port)
}
// Call the function immediately when the server starts // Call the function immediately when the server starts
models.FetchGRDFAuthAPI() models.FetchGRDFAuthAPI()
// then call GRDF auth api every two hours // then call GRDF auth api every two hours
ticker := time.NewTicker(time.Hour * 2) ticker := time.NewTicker(time.Hour * 2)
quit := make(chan struct{}) quit := make(chan struct{})
go func() { go func() {
for { for {
select { select {
case <-ticker.C: case <-ticker.C:
models.FetchGRDFAuthAPI() models.FetchGRDFAuthAPI()
case <-quit: case <-quit:
ticker.Stop() ticker.Stop()
return return
}
} }
}() }
} }()
// Serve locally with https // Serve locally with https
log.Fatal(http.ListenAndServeTLS(":"+strconv.Itoa(httpsPort), "./dev_certificates/localhost.crt", "./dev_certificates/localhost.key", rootMux.Router)) 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.
Finish editing this message first!
Please register or to comment