mirror of
https://github.com/unraid/api.git
synced 2026-04-30 04:01:10 -05:00
chore: add debug logging to docker events
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user