Skip to content

Commit

Permalink
TEMP: more logging
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexTugarev committed May 25, 2022
1 parent 6ce07a3 commit eaa9cba
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions components/server/ee/src/user/eligibility-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,16 +147,20 @@ export class EligibilityService {

const hasHitParallelWorkspaceLimit = async (): Promise<HitParallelWorkspaceLimit | undefined> => {
const max = await this.getMaxParallelWorkspaces(user);
const allRunningInstances = await runningInstances;
const instances = (await runningInstances).filter(
(i) => i.creationTime < new Date(Date.now() + 1000).toISOString() || i.status.phase !== "preparing",
);
log.error(
`running instances ${instances.map((i) =>
JSON.stringify({
id: i.workspaceId,
status: i.status.phase,
}),
)}`,
`(${date.toISOString()}) running instances ${allRunningInstances
.map((i) =>
JSON.stringify({
id: i.workspaceId,
creationTime: i.creationTime,
status: i.status.phase,
}),
)
.join(",")}`,
);
const current = instances.length; // >= parallelWorkspaceAllowance;
if (current >= max) {
Expand Down

0 comments on commit eaa9cba

Please sign in to comment.