@kumori/aurora-backend-handler 1.1.16 → 1.1.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -262,7 +262,7 @@ const updateEnvironmentConsumption = (
262
262
 
263
263
  servicesMap.forEach((service, svcId) => {
264
264
  if (service.environment === serviceEnvironmentId) {
265
- const currentRevisionKey = `${svcId}_${service.currentRevision}`;
265
+ const currentRevisionKey = `/tenant/${svcId.split('/')[0]}/service/${svcId.split('/')[1]}/revision/${service.currentRevision}`;
266
266
  const currentRevision = revisionsMap.get(currentRevisionKey);
267
267
  if (currentRevision) {
268
268
  totalEnvCpu += currentRevision.usage.limit.cpu.max || 0;
@@ -300,7 +300,7 @@ const updateAccountConsumption = (
300
300
 
301
301
  servicesMap.forEach((service, svcId) => {
302
302
  if (service.account === serviceAccountId) {
303
- const currentRevisionKey = `${svcId}_${service.currentRevision}`;
303
+ const currentRevisionKey = `/tenant/${svcId.split('/')[0]}/service/${svcId.split('/')[1]}/revision/${service.currentRevision}`;
304
304
  const currentRevision = revisionsMap.get(currentRevisionKey);
305
305
  if (currentRevision) {
306
306
  totalAccountCpu += currentRevision.usage.limit.cpu.max || 0;
@@ -338,7 +338,7 @@ export const handleRevisionEvent = ({
338
338
  accountsMap,
339
339
  }: HandleRevisionEventParams): HandleRevisionEventResult => {
340
340
  const serviceId = `${parentParts.tenant}/${parentParts.service}`;
341
- const revisionKey = `${serviceId}_${entityId}`;
341
+ const revisionKey = `${eventData.id.parent.name}/revision/${entityId}`;
342
342
  const { roles, instances, usedCpu, usedMemory } = processRolesAndInstances(
343
343
  eventData,
344
344
  serviceId,
@@ -180,7 +180,7 @@ export const handleServiceEvent = ({
180
180
  }: HandleServiceEventParams): HandleServiceEventResult => {
181
181
  const serviceFullKey = `${parentParts.tenant}/${entityId}`;
182
182
  const serviceTenantId = parentParts.tenant;
183
- const currentRevisionKey = `${serviceFullKey}_${eventData.status.revision}`;
183
+ const currentRevisionKey = `${eventData.id.parent.name}/service/${entityId}/revision/${eventData.status.revision}`;
184
184
  const currentRevision = revisionsMap.get(currentRevisionKey);
185
185
 
186
186
  const projectLabel = eventData.meta?.labels?.project;
@@ -189,7 +189,7 @@ export const handleServiceEvent = ({
189
189
 
190
190
  const serviceRevisions: Revision[] = [];
191
191
  revisionsMap.forEach((revision, key) => {
192
- if (key.startsWith(`${serviceFullKey}_`)) {
192
+ if (key.startsWith(`${eventData.id.parent.name}/service/${entityId}/revision/`)) {
193
193
  serviceRevisions.push(revision);
194
194
  }
195
195
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kumori/aurora-backend-handler",
3
- "version": "1.1.16",
3
+ "version": "1.1.17",
4
4
  "description": "backend handler",
5
5
  "main": "backend-handler.ts",
6
6
  "scripts": {
@@ -1996,7 +1996,7 @@ const resolveServiceStatus = (service: Service): Service => {
1996
1996
  return service;
1997
1997
  }
1998
1998
 
1999
- const revisionKey = `${service.tenant}/${service.name}_${service.currentRevision}`;
1999
+ const revisionKey = `/tenant/${service.tenant}/service/${service.name}/revision/${service.currentRevision}`;
2000
2000
  const currentRevision = revisionsMap.get(revisionKey);
2001
2001
 
2002
2002
  if (!currentRevision) {