Skip to content

Commit

Permalink
Merge pull request #4 from m-mizutani/fix/update-import-log
Browse files Browse the repository at this point in the history
Update import log of otx each time
  • Loading branch information
m-mizutani authored Jan 27, 2024
2 parents d70dadb + 2bfed48 commit 7e25d74
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions pkg/feed/otx/subscribed.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,18 +118,18 @@ func (x *Subscribed) Import(ctx context.Context, clients *infra.Clients) error {
}
target = *nextURL

if apiResp.Next == "" {
break
if latest != nil {
log := model.ImportLog{
CheckedAt: time.Now(),
LatestRecord: *latest,
}
if err := clients.Database().PutImportLog(ctx, types.FeedOTXSubscribed, &log); err != nil {
return goerr.Wrap(err, "Fail to put latest time")
}
}
}

if latest != nil {
log := model.ImportLog{
CheckedAt: time.Now(),
LatestRecord: *latest,
}
if err := clients.Database().PutImportLog(ctx, types.FeedOTXSubscribed, &log); err != nil {
return goerr.Wrap(err, "Fail to put latest time")
if apiResp.Next == "" {
break
}
}

Expand Down

0 comments on commit 7e25d74

Please sign in to comment.