twitterchiver/related_fetcher: treat 403 as deleted as well

This commit is contained in:
Luke Granger-Brown 2020-10-19 23:57:44 +00:00
parent e6180a6850
commit cab1df2966

View file

@ -237,8 +237,8 @@ func mediaFetchTick(ctx context.Context, cfg WorkerConfig) error {
switch resp.StatusCode { switch resp.StatusCode {
case http.StatusOK: case http.StatusOK:
break // This is what we expect. break // This is what we expect.
case http.StatusNotFound: case http.StatusNotFound, http.StatusForbidden:
log.Printf("[%v:%d:%v] got a 404; marking as successful since this has probably been deleted.", cfg.Name, t.ID, u) log.Printf("[%v:%d:%v] got a %d; marking as successful since this has probably been deleted.", cfg.Name, t.ID, u, resp.StatusCode)
return nil return nil
default: default:
return fmt.Errorf("HTTP status %d - %v", resp.StatusCode, resp.Status) return fmt.Errorf("HTTP status %d - %v", resp.StatusCode, resp.Status)