Skip to content

Commit

Permalink
add some logs in server scraper worker function
Browse files Browse the repository at this point in the history
  • Loading branch information
AmyrAhmady committed Oct 4, 2023
1 parent 664c4f2 commit b8fa00a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/services/serverworker/serverworker.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ func (w *Worker) RunWithSeed(ctx context.Context, window time.Duration, addresse
func (w *Worker) Run(ctx context.Context, window time.Duration) error {
tc := time.NewTicker(window)
for range tc.C {
zap.L().Info("Running server scraper worker")
addresses, err := w.db.GetServersToQuery(ctx, window)
if err != nil {
zap.L().Error("failed to get servers to query",
Expand Down Expand Up @@ -117,6 +118,7 @@ func (w *Worker) Run(ctx context.Context, window time.Duration) error {
continue
}

zap.L().Info("Saving all servers into a JSON file to be used as cache")
// Let's save all servers info our cache file to be used in our API data processing instead of DB
jsonData, err := json.Marshal(all)
if err != nil {
Expand Down

0 comments on commit b8fa00a

Please sign in to comment.