Skip to content

Commit 6f0ff00

Browse files
Merge pull request #22 from CopilotNext/feature/new-metric-schema
Feature/new metric schema
2 parents f2156a0 + 3da47e2 commit 6f0ff00

3 files changed

Lines changed: 12 additions & 2 deletions

File tree

.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# to set whether save the child team data or not, default is false
2-
CHILD_TEAM_ENABLED=true
2+
CHILD_TEAM_ENABLED=false
33
# to set whether save the tenant information automatically or not, default is false
44
TENANT_AUTO_SAVE=true
55
# the below parameters are only used for nodejs server, not vue app since the vue app is a client side app
File renamed without changes.

src/server.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,6 +543,16 @@ const runJob = async () => {
543543
// Get current time and log it.
544544
console.log(`Usage Data saved successfully for tenant ${tenant.scopeName} at ${now}`);
545545

546+
//wait for 1 second before saving the metrics data
547+
await new Promise(resolve => setTimeout(resolve, 1000));
548+
549+
const metricsService = await CopilotServiceFactory.createMetricsService(tenant);
550+
await metricsService.saveMetrics();
551+
// Get current time and log it.
552+
console.log(`Metrics Data saved successfully for tenant ${tenant.scopeName} at ${now}`);
553+
554+
//wait for 1 second before saving the seat data
555+
await new Promise(resolve => setTimeout(resolve, 1000));
546556
// get the seat service for the tenant, and save the seat data
547557
const seatService = await CopilotServiceFactory.createSeatService(tenant);
548558
await seatService.saveSeatData();
@@ -560,7 +570,7 @@ const runJob = async () => {
560570
};
561571

562572
// Run it once the server starts
563-
//runJob();
573+
runJob();
564574

565575
// Run job every 12 hours
566576
setInterval(runJob, 12 * 60 * 60 * 1000);

0 commit comments

Comments
 (0)