AdiA
Reactiflux5y ago
9 replies
Adi

Adi – 14-12 Jan 23

I am trying to upload media but can I add a time interval between first media upload and second media upload?? Like interval of 2secs so that first media upload gets completed and then after 2secs it starts uploading 2nd media. Is it possible to do it?
code:
const mediaIds = [];
for (const item of status.images) {
      const mediaId = await mediaUpload(item, process.env.CONSUMER_KEY, process.env.CONSUMER_SECRET, access_token_key, access_token_secret);
      mediaIds.push(mediaId);
}

After successful completion of upload it returns mediaIds which I am storing but I want to add delay between 2 uploads how can I do it? Any suggestions?
Was this page helpful?