mirror of
https://github.com/yldio/copilot.git
synced 2024-11-14 15:20:06 +02:00
feat(portal-api): rename watchers to watches
This commit is contained in:
parent
2ece20ead9
commit
cdd6d98af4
@ -176,7 +176,7 @@ exports.fromInstance = function (instance) {
|
||||
deploymentGroupId: instance.deployment_group_id,
|
||||
status: instance.status,
|
||||
healthy: instance.healthy,
|
||||
watchers: instance.watchers,
|
||||
watches: instance.watches,
|
||||
jobs: instance.jobs
|
||||
};
|
||||
};
|
||||
@ -191,7 +191,7 @@ exports.toInstance = function (clientInstance) {
|
||||
service_id: clientInstance.serviceId,
|
||||
status: clientInstance.status,
|
||||
healthy: clientInstance.healthy,
|
||||
watchers: clientInstance.watchers,
|
||||
watches: clientInstance.watches,
|
||||
jobs: clientInstance.jobs
|
||||
});
|
||||
};
|
||||
|
@ -266,7 +266,7 @@ module.exports = class ContainerPilotWatcher extends Events {
|
||||
});
|
||||
}
|
||||
|
||||
_saveInstance ({ id, healthy, watchers, jobs }, cb) {
|
||||
_saveInstance ({ id, healthy, watches, jobs }, cb) {
|
||||
if (!id) {
|
||||
return cb();
|
||||
}
|
||||
@ -274,7 +274,7 @@ module.exports = class ContainerPilotWatcher extends Events {
|
||||
this._data.updateInstance({
|
||||
id,
|
||||
healthy,
|
||||
watchers,
|
||||
watches,
|
||||
jobs
|
||||
}, cb);
|
||||
}
|
||||
@ -438,12 +438,15 @@ module.exports = class ContainerPilotWatcher extends Events {
|
||||
services: ForceArray(dg.services).map((service) => {
|
||||
return Object.assign({}, service, {
|
||||
instances: ForceArray(service.instances).map((instance) => {
|
||||
const watches = Get(instance, 'cp.Watches', []);
|
||||
const jobs = Get(instance, 'cp.Services', []).map(({ Name }) => {
|
||||
return Name;
|
||||
});
|
||||
|
||||
return Object.assign({}, instance, {
|
||||
healthy: this._resolveInstanceHealth(service, instance),
|
||||
jobs: Get(instance, 'cp.Services', []).map(({ Name }) => {
|
||||
return Name;
|
||||
}),
|
||||
watches: Get(instance, 'cp.Watches', [])
|
||||
jobs,
|
||||
watches
|
||||
});
|
||||
})
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user