Skip to content

Commit f720c0f

Browse files
authored
fix: add delay to pollForProcessingImage (#188)
# Description Adds back the delay that is present in next-cloudinary, to prevent spam requests ## Type of change <!-- Please select all options that are applicable. --> - [x] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] Fix or improve the documentation - [ ] This change requires a documentation update # Checklist <!-- These must all be followed and checked. --> - [x] I have followed the contributing guidelines of this project as mentioned in [CONTRIBUTING.md](/CONTRIBUTING.md) - [ ] I have created an [issue](https://github.com/colbyfayock/cloudinary-util/issues) ticket for this PR - [x] I have checked to ensure there aren't other open [Pull Requests](https://github.com/colbyfayock/cloudinary-util/pulls) for the same update/change? - [x] I have performed a self-review of my own code - [x] I have run tests locally to ensure they all pass - [x] I have commented my code, particularly in hard-to-understand areas - [x] I have made corresponding changes needed to the documentation
1 parent 5b00379 commit f720c0f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

packages/util/src/lib/cloudinary.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ export async function pollForProcessingImage(
175175
});
176176
} catch (e: any) {
177177
if (e.status === 423) {
178+
await new Promise((resolve) => setTimeout(resolve, 250));
178179
return await pollForProcessingImage(options);
179180
}
180181

0 commit comments

Comments
 (0)