Skip to content

Commit e54059a

Browse files
committed
fix: refresh token before starting scraper
1 parent f7fcb76 commit e54059a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

cmd/scraper.go

+7-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,13 @@ var (
4545
Use: "scraper",
4646
Short: "Runs a scraper for grades for the distributed Discord notifications API",
4747
RunE: func(cmd *cobra.Command, args []string) error {
48-
log.Info("Running scraper")
48+
log.Info("Refreshing token")
49+
refreshToken(
50+
defaultViper.GetString(UsernameViperKey.Key()),
51+
credentialsViper.GetString(PasswordViperKey.Key()),
52+
)
53+
54+
log.Info("Starting scraper thread")
4955

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

0 commit comments

Comments
 (0)