chore: decouple analytics portainer startup

This commit is contained in:
lingniu
2026-07-01 14:21:41 +08:00
parent a6784bc8c3
commit 1cca142550
2 changed files with 11 additions and 1 deletions

View File

@@ -189,7 +189,6 @@ services:
restart: unless-stopped
mem_limit: ${VEHICLE_ANALYTICS_MEM_LIMIT:-1024m}
depends_on:
- gb32960-ingest-app
- jt808-ingest-app
environment:
<<: *common-env

View File

@@ -498,6 +498,17 @@ class PortainerComposeResourceLimitsTest {
.doesNotContain("VEHICLE_STATE_ENABLED");
}
@Test
void vehicleAnalyticsComposeDependsOnlyOnJt808Ingest() throws IOException {
String compose = Files.readString(repositoryRoot().resolve("deploy/portainer/docker-compose.yml"));
String analyticsService = serviceBlock(compose, "vehicle-analytics-app");
assertThat(analyticsService)
.contains(" depends_on:\n - jt808-ingest-app")
.doesNotContain("- gb32960-ingest-app")
.doesNotContain("- yutong-mqtt-app");
}
@Test
void vehicleAnalyticsDoesNotInheritRedisStateEnvironment() throws IOException {
String compose = Files.readString(repositoryRoot().resolve("deploy/portainer/docker-compose.yml"));