applegrew / django-select2

This is a Django integration for Select2
MIT License
712 stars 314 forks source link

ConnectionAbortedError with fast typing #523

Closed MatheusZickuhr closed 5 years ago

MatheusZickuhr commented 5 years ago

I'am using the HeavySelect2MultipleWidget for a select field, but when typing fast the server recieve too many ajax requests and throws the exception 'ConnectionAbortedError'.

There's a way i can delay the ajax requests and get rid of this error?

codingjoe commented 5 years ago

Hi @MatheusZickuhr, I think this is what you are looking for: https://select2.org/data-sources/ajax#rate-limiting-requests

Select2 uses a method called debouncing, which means it will wait for the given delay after the last key stroke before it will start a request. Select2 will also kill connections client site when starting a new one.

Best -Johannes