@faable/faable 3.1.0 â 3.1.1
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.
|
@@ -99,7 +99,9 @@ const secrets_set = {
|
|
|
99
99
|
const existing = await ctx.api.getAppSecrets(app_id);
|
|
100
100
|
const merged = merge_app_secrets(existing, parsed);
|
|
101
101
|
await ctx.api.createSecretsBatch(app.id, app.team, merged);
|
|
102
|
-
const current = new
|
|
102
|
+
const current = new Map(existing
|
|
103
|
+
.filter(s => s.related_model === 'app')
|
|
104
|
+
.map(s => [s.name, s.value]));
|
|
103
105
|
const updated = parsed.filter(({ name }) => current.has(name)).length;
|
|
104
106
|
if (parsed.length <= MAX_DETAILED) {
|
|
105
107
|
for (const { name } of parsed) {
|
|
@@ -112,7 +114,14 @@ const secrets_set = {
|
|
|
112
114
|
log.info(`đ ${parsed.length - updated} added, ${updated} updated`);
|
|
113
115
|
}
|
|
114
116
|
log.info(`â
${parsed.length} secret(s) saved to ${app_id}.`);
|
|
115
|
-
|
|
117
|
+
// Only claim the restart when something actually changed. Setting a name
|
|
118
|
+
// to the value it already has is a no-op end to end â the API compares
|
|
119
|
+
// before writing and never emits the event, so the pod keeps running â
|
|
120
|
+
// and this line used to promise a restart that was not coming.
|
|
121
|
+
const changed = parsed.some(({ name, value }) => current.get(name) !== value);
|
|
122
|
+
log.info(changed
|
|
123
|
+
? `âšī¸ The app is restarting to apply the changes.`
|
|
124
|
+
: `âšī¸ Already up to date â the app was not restarted.`);
|
|
116
125
|
}
|
|
117
126
|
};
|
|
118
127
|
|