Skip to content

Commit e62861c

Browse files
committed
add null to file query
1 parent 9403fbe commit e62861c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

backend/src/services/queue.service.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { InjectRepository } from '@nestjs/typeorm';
44
import {
55
FindOptionsWhere,
66
In,
7+
IsNull,
78
LessThan,
89
Like,
910
MoreThan,
@@ -171,8 +172,12 @@ export class QueueService implements OnModuleInit {
171172
success: boolean;
172173
fileCount: number;
173174
}> {
175+
// search for files with no hash (empty or null) and state OK
174176
const files = await this.fileRepository.find({
175-
where: { hash: '', state: FileState.OK },
177+
where: [
178+
{ hash: IsNull(), state: FileState.OK },
179+
{ hash: '', state: FileState.OK },
180+
],
176181
relations: ['mission', 'mission.project'],
177182
});
178183

0 commit comments

Comments
 (0)