freeschema 1.0.10 → 1.0.11

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.
Files changed (2) hide show
  1. package/bin/freeschema.js +12 -1
  2. package/package.json +1 -1
package/bin/freeschema.js CHANGED
@@ -122,9 +122,18 @@ function generateMosquittoPassword(username, password) {
122
122
  return `${username}:$7$${iterations}$${salt.toString('base64')}$${hash.toString('base64')}\n`;
123
123
  }
124
124
 
125
+ function isContainerHealthy(containerName) {
126
+ const r = spawnSync('docker', [
127
+ 'inspect', '--format', '{{.State.Health.Status}}', containerName
128
+ ], { stdio: 'pipe' });
129
+ return (r.stdout || '').toString().trim() === 'healthy';
130
+ }
131
+
125
132
  function waitForAccessControl(container) {
133
+ if (isContainerHealthy(container)) return true; // already healthy — no wait needed
126
134
  process.stdout.write(' Waiting for access-control-server');
127
- for (let i = 0; i < 30; i++) {
135
+ for (let i = 0; i < 60; i++) { // 60 × 2s = 120s
136
+ if (isContainerHealthy(container)) { process.stdout.write(' ready\n'); return true; }
128
137
  const r = spawnSync('docker', [
129
138
  'exec', container, 'curl', '-sf', 'http://localhost:7000/health'
130
139
  ], { stdio: 'pipe' });
@@ -770,8 +779,10 @@ function getWicoContainer() {
770
779
  }
771
780
 
772
781
  function waitForWicoServer(container, maxAttempts = 60) {
782
+ if (isContainerHealthy(container)) return true; // already healthy — no wait needed
773
783
  process.stdout.write(' Waiting for wico-server');
774
784
  for (let i = 0; i < maxAttempts; i++) {
785
+ if (isContainerHealthy(container)) { process.stdout.write(' ready\n'); return true; }
775
786
  const r = spawnSync('docker', [
776
787
  'exec', container, 'curl', '-sf', 'http://localhost:7000/health'
777
788
  ], { stdio: 'pipe' });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "freeschema",
3
- "version": "1.0.10",
3
+ "version": "1.0.11",
4
4
  "description": "FreeSchema — self-hosted deployment CLI",
5
5
  "keywords": [
6
6
  "freeschema",