create-dacosta-proj 1.0.26 → 1.0.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-dacosta-proj",
3
- "version": "1.0.26",
3
+ "version": "1.0.27",
4
4
  "bin": {
5
5
  "create-dacosta-proj": "./index.js"
6
6
  }
@@ -6,6 +6,7 @@ const { SimpleSupabase } = require('simple-supabase');
6
6
  const { createClient: createSupabaseClient } = require('@supabase/supabase-js');
7
7
  const { createClient: createRedisClient } = require('redis');
8
8
  const redisLock = require('@/helpers/redisLock');
9
+ const wait = require('./wait');
9
10
 
10
11
  module.exports = async () => {
11
12
 
@@ -27,7 +28,17 @@ module.exports = async () => {
27
28
  // Redis
28
29
 
29
30
  const redis = createRedisClient();
30
- await redis.connect();
31
+ try {
32
+ await redis.connect();
33
+ while (true) {
34
+ try { await redis.ping(); break; }
35
+ catch (err) {
36
+ if (!err?.message?.includes('LOADING')) throw err;
37
+ await wait(500);
38
+ }
39
+ }
40
+ }
41
+ catch (err) { console.log('Redis Failed', err); return; }
31
42
 
32
43
  global.redis = redis;
33
44
  global.redisLock = redisLock(redis);