Просмотр исходного кода

Disable script in production

GitOrigin-RevId: 81fe077a5816a23fa20c78a6271fbdf62021e3b2
Andrew Rumble 1 год назад
Родитель
Сommit
07b47606c1
1 измененных файлов с 7 добавлено и 0 удалено
  1. 7 0
      services/web/scripts/recurly/resync_subscriptions.mjs

+ 7 - 0
services/web/scripts/recurly/resync_subscriptions.mjs

@@ -181,6 +181,13 @@ const setup = () => {
   }
   }
 }
 }
 
 
+if (process.env.NODE_ENV !== 'development') {
+  console.warn(
+    'This script can cause issues with manually amended subscriptions and can also exhaust our rate-limit with Recurly so is not intended to be run in production. Please use it in development environments only.'
+  )
+  process.exit(1)
+}
+
 setup()
 setup()
 await run()
 await run()
 process.exit()
 process.exit()