NexGenAnalytics / WorkVisualizer

High-level, interactive, visual performance analysis for High-Performance Computing (HPC)
https://www.workvisualizer.com/
Other
4 stars 0 forks source link

Explore rate limiting with p limit #65

Open cwschilly opened 3 months ago

cwschilly commented 3 months ago

We attempted to use p-limit for rate limiting, but ran into errors/vulnerability issues with the npm packages that we currently use.

Investigate these steps:

npm install p-limit
import pLimit from 'p-limit';
if (files && files.length > 0) {
            const limit = pLimit(5);
const uploadPromises = formDataArray.map((formData) =>
                    limit(() => [axios.post](http://axios.post/)('http://127.0.0.1:8000/api/upload', formData, {
                        headers: { 'Content-Type': 'multipart/form-data' },
                    }))
                );