chore: add debug logging to docker events

This commit is contained in:
Alexis Tyler
2021-07-12 13:20:30 +09:30
parent 24a74a52bb
commit 30be125858
2 changed files with 7 additions and 5 deletions
@@ -51,8 +51,6 @@ export const getDockerContainers = async (context: Context): Promise<CoreResult>
const result = containers
.map(object => camelCaseKeys(object, { deep: true }))
.map(container => {
// This will be fixed once camelCaseKeys has correct typings
// @ts-expect-error
const names = container.names[0];
return {
...container,
+7 -3
View File
@@ -381,16 +381,20 @@ bus.on('var', async data => {
});
// On Docker event update info with { apps: { installed, started } }
dee.on('*', async (data: { Type: string }) => {
dee.on('*', async (data: { Type: 'container' | string; Action: 'start' | 'stop' | string; from: string }) => {
// Only listen to container events
if (data.Type !== 'container') {
return;
}
log.debug(`[${data.from}] ${data.Type}->${data.Action}`);
const user: User = { id: '-1', description: 'Internal service account', name: 'internal', role: 'admin', password: false };
const { json } = await modules.getAppCount({ user });
await publish('info', 'UPDATED', {
apps: json
await pubsub.publish('info', {
info: {
apps: json
}
});
});