@yobytechautomation/config-lib 0.2.3 → 0.2.5
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.
|
@@ -75,7 +75,7 @@ class BaseConfigServiceImpl {
|
|
|
75
75
|
var _a;
|
|
76
76
|
const cachePath = path.join(process.cwd(), '.license-cache.json');
|
|
77
77
|
const apiKey = this.env.LICENSE_KEY;
|
|
78
|
-
if (!apiKey
|
|
78
|
+
if (!apiKey) {
|
|
79
79
|
throw new Error('LICENSE_KEY missing');
|
|
80
80
|
}
|
|
81
81
|
try {
|
|
@@ -108,8 +108,9 @@ class BaseConfigServiceImpl {
|
|
|
108
108
|
const last = new Date(data.lastValidated);
|
|
109
109
|
const now = new Date();
|
|
110
110
|
const diffHours = (now.getTime() - last.getTime()) / (1000 * 60 * 60);
|
|
111
|
-
|
|
112
|
-
|
|
111
|
+
const MAX_OFFLINE_HOURS = 0.5; // 30 minutes
|
|
112
|
+
if (diffHours <= MAX_OFFLINE_HOURS) {
|
|
113
|
+
console.log('⚠️ Using cached license (temporary offline)');
|
|
113
114
|
return;
|
|
114
115
|
}
|
|
115
116
|
}
|