Skip to content

Commit

Permalink
fix: refresh token before starting scraper
Browse files Browse the repository at this point in the history
  • Loading branch information
Lutonite committed Feb 26, 2024
1 parent f7fcb76 commit e54059a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cmd/scraper.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,13 @@ var (
Use: "scraper",
Short: "Runs a scraper for grades for the distributed Discord notifications API",
RunE: func(cmd *cobra.Command, args []string) error {
log.Info("Running scraper")
log.Info("Refreshing token")
refreshToken(
defaultViper.GetString(UsernameViperKey.Key()),
credentialsViper.GetString(PasswordViperKey.Key()),
)

log.Info("Starting scraper thread")

c := make(chan os.Signal)
signal.Notify(c, os.Interrupt, syscall.SIGTERM)
Expand Down

0 comments on commit e54059a

Please sign in to comment.