Skip to content

Commit

Permalink
fix sleep
Browse files Browse the repository at this point in the history
  • Loading branch information
seanbudd committed Jun 25, 2024
1 parent 89362fb commit 91921b9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/virusTotalAnalysis.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
const glob = require('glob');

function sleep(n) {
Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, n);
}

module.exports = ({core}, globPattern) => {
const fs = require('fs');
const { exec } = require('child_process');
Expand Down Expand Up @@ -56,7 +60,6 @@ module.exports = ({core}, globPattern) => {
fs.writeFileSync('reviewedAddons.json', stringified);
core.setFailed('VirusTotal analysis failed');
});
await sleep(20 * 1000);
});
// Sleep 20 seconds to avoid rate limiting
sleep(20 * 1000);
};
4 changes: 4 additions & 0 deletions .github/workflows/virusTotalSubmit.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
const glob = require('glob');

function sleep(n) {
Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, n);
}

module.exports = ({core}, globPattern) => {
const fs = require('fs');
const { exec } = require('child_process');
Expand Down

0 comments on commit 91921b9

Please sign in to comment.