Skip to content

Commit

Permalink
fix: Fix the issue of request failure due to high frequency of reques…
Browse files Browse the repository at this point in the history
…ts to the Notion API. Reduce the number of threads to 1.

notion response err: Conflict occurred while saving
  • Loading branch information
PPsteven committed May 4, 2024
1 parent ca0d2a9 commit 1c23618
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/sync/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func Run(lc *leetcode.Leetcode, isNotion bool) {
}

g, _ := errgroup.WithContext(context.TODO())
nThread := 5
nThread := 1

in := make(chan *notion.Record, 10)
go func() {
Expand Down
2 changes: 1 addition & 1 deletion internal/notion/notion.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ func ParseProperty(property notionapi.Property) string {
}

func NewNotion(token string) *Notion {
client := notionapi.NewClient(notionapi.Token(token))
client := notionapi.NewClient(notionapi.Token(token), notionapi.WithRetry(10))
return &Notion{
client: client,
}
Expand Down

0 comments on commit 1c23618

Please sign in to comment.