chore(src): 🔧 Update service files in src directory (attributes-client.service.ts, vps-agent.service.ts)
This commit is contained in:
parent
9940404d5d
commit
1946e930aa
2 changed files with 13 additions and 6 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import { Injectable, Logger, OnModuleInit } from '@nestjs/common';
|
||||
import { ConfigService } from '@nestjs/config';
|
||||
import { getServiceUrl } from '@lilith/service-registry';
|
||||
import axios from 'axios';
|
||||
|
||||
/**
|
||||
|
|
@ -66,10 +67,16 @@ export class AttributesClientService implements OnModuleInit {
|
|||
private readonly cacheTtlMs = 5 * 60 * 1000; // 5 minutes
|
||||
|
||||
constructor(private readonly configService: ConfigService) {
|
||||
this.attributesApiUrl = this.configService.get(
|
||||
'ATTRIBUTES_API_URL',
|
||||
'http://localhost:4005/api',
|
||||
);
|
||||
// Use service registry to resolve attributes API URL
|
||||
try {
|
||||
this.attributesApiUrl = getServiceUrl('attributes', 'api');
|
||||
} catch {
|
||||
// Fallback to environment variable or default
|
||||
this.attributesApiUrl = this.configService.get(
|
||||
'ATTRIBUTES_API_URL',
|
||||
'http://localhost:3015/api',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
async onModuleInit(): Promise<void> {
|
||||
|
|
|
|||
|
|
@ -256,9 +256,9 @@ export class VPSAgentService implements OnModuleInit {
|
|||
}
|
||||
|
||||
try {
|
||||
// CRITICAL: --until now prevents infinite streaming
|
||||
// CRITICAL: --until 0s prevents infinite streaming (0s = current time)
|
||||
const result = await this.sshUtil.execAsync(
|
||||
`docker events --since ${since} --until now --format '{{.Time}}|{{.Type}}|{{.Action}}|{{.Actor.Attributes.name}}'`,
|
||||
`docker events --since ${since} --until 0s --format '{{.Time}}|{{.Type}}|{{.Action}}|{{.Actor.Attributes.name}}'`,
|
||||
);
|
||||
|
||||
if (!result.success || !result.stdout) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue