Skip to content

Commit

Permalink
Manage the Vault token inside the go routine, otherwise it will try t… (
Browse files Browse the repository at this point in the history
#6)

* Manage the Vault token inside the go routine, otherwise it will try to always use the toke issued at server startup, which has limited time validity

* Bump release
  • Loading branch information
roivaz authored Jan 29, 2020
1 parent 7fb2464 commit cc0f148
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion RELEASE
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.4.2
0.4.3
9 changes: 5 additions & 4 deletions cmd/app/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,14 @@ func runServer(cmd *cobra.Command, args []string) {
}

func start(vc vault.AuthenticatedClient) {

// Start RotateCRL cron like task
client, err := vc.GetClient()
if err != nil {
panic("Failed while creating Vault client")
}
c := cron.New()
c.AddFunc("@hourly", func() {
client, err := vc.GetClient()
if err != nil {
panic("Failed while creating Vault client")
}
err = operations.RotateCRL(
&operations.RotateCRLRequest{
Client: client,
Expand Down

0 comments on commit cc0f148

Please sign in to comment.