mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-05 20:32:42 +02:00
chore(v2): delay i18n-staging deployment to avoid Crowdin 409 errors (#4740)
This commit is contained in:
parent
9812bf89a8
commit
83ce660c0a
1 changed files with 14 additions and 0 deletions
|
@ -33,6 +33,20 @@ async function hasBuildInProgress() {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function run() {
|
async function run() {
|
||||||
|
// We delay a bit the i18n staging deployment
|
||||||
|
// Because sometimes, prod + i18n-staging call this script at the exact same time
|
||||||
|
// And then both try to dl the translations at the same time, and then we have a 409 error
|
||||||
|
// This delay makes sure prod starts to dl the translations in priority
|
||||||
|
if (
|
||||||
|
process.env.NETLIFY === 'true' &&
|
||||||
|
process.env.SITE_NAME === 'docusaurus-i18n-staging'
|
||||||
|
) {
|
||||||
|
console.log(
|
||||||
|
'[Crowdin] Delaying the docusaurus-i18n-staging deployment to avoid 409 errors',
|
||||||
|
);
|
||||||
|
await delay(30000);
|
||||||
|
}
|
||||||
|
|
||||||
const timeBefore = Date.now();
|
const timeBefore = Date.now();
|
||||||
while (true) {
|
while (true) {
|
||||||
if (Date.now() - timeBefore > timeout) {
|
if (Date.now() - timeBefore > timeout) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue