Skip to content

Commit

Permalink
fix(projects-service): ContainerService errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Clashsoft committed Mar 18, 2024
1 parent d673e7b commit 2f35a31
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions services/apps/projects/src/container/container.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {setTimeout} from 'timers/promises';
import {Extract} from 'unzipper';
import {environment} from '../environment';
import {Project} from '../project/project.schema';
import {ProjectService} from '../project/project.service';
import {allowedFilenameCharacters, ContainerDto, CreateContainerDto} from './container.dto';

const projectStorageTypes = ['projects', 'config'] as const;
Expand Down Expand Up @@ -277,12 +276,12 @@ ${eofMarker}`]);

async findOne(projectId: string, userId: string): Promise<ContainerDto | null> {
const containers = await this.docker.listContainers({
all: 1,
all: true,
limit: 1,
filters: {
filters: JSON.stringify({
status: ['created', 'running'],
label: [`org.fulib.project=${projectId}`, `org.fulib.user=${userId}`],
},
}),
});
if (containers.length === 0) {
return null;
Expand Down Expand Up @@ -324,10 +323,10 @@ ${eofMarker}`]);
@Cron(CronExpression.EVERY_MINUTE)
async checkAllHeartbeats() {
const containers = await this.docker.listContainers({
filters: {
filters: JSON.stringify({
label: ['org.fulib.token'],
status: ['created', 'running'],
},
}),
});

await Promise.all(containers.map(async info => {
Expand Down

0 comments on commit 2f35a31

Please sign in to comment.