Skip to content

Commit 8401d3e

Browse files
authored
Handle the case where a Twitter user is suspended in the info update worker (#175)
1 parent 0714a15 commit 8401d3e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/code/async/user/twitter.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ func (p *service) processNewTwitterRegistrations(ctx context.Context) error {
194194
func (p *service) refreshTwitterUserInfo(ctx context.Context, username string) error {
195195
user, err := p.twitterClient.GetUserByUsername(ctx, username)
196196
if err != nil {
197-
if strings.Contains(strings.ToLower(err.Error()), "could not find user with username") {
197+
if strings.Contains(strings.ToLower(err.Error()), "could not find user with username") || strings.Contains(strings.ToLower(err.Error()), "user has been suspended") {
198198
err = p.onTwitterUsernameNotFound(ctx, username)
199199
if err != nil {
200200
return errors.Wrap(err, "error updating cached user state")

0 commit comments

Comments
 (0)