Skip to content

Commit 81136c9

Browse files
committed
fix: filter on process date the raw responses tthat needs to be processed
1 parent 648843f commit 81136c9

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/main/java/fr/insee/genesis/infrastructure/adapter/RawResponseMongoAdapter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,6 @@ public List<String> getUnprocessedCollectionIds() {
5656
@Override
5757
public Set<String> findUnprocessedInterrogationIdsByCollectionInstrumentId(String collectionInstrumentId) {
5858
// We remove duplicate ids
59-
return new HashSet<>(repository.findInterrogationIdByCollectionInstrumentId(collectionInstrumentId));
59+
return new HashSet<>(repository.findInterrogationIdByCollectionInstrumentIdAndProcessDateIsNull(collectionInstrumentId));
6060
}
6161
}

src/main/java/fr/insee/genesis/infrastructure/repository/RawResponseRepository.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ public interface RawResponseRepository extends MongoRepository<RawResponseDocume
2121
List<String> findDistinctCollectionInstrumentIdByProcessDateIsNull();
2222

2323
@Aggregation(pipeline = {
24-
"{ $match: { collectionInstrumentId: ?0 } }",
24+
"{ $match: { collectionInstrumentId: ?0,processDate: null } }",
2525
"{ $project: { _id: 0, interrogationId: '$interrogationId' } }"
2626
})
27-
List<String> findInterrogationIdByCollectionInstrumentId(String collectionInstrumentId);
27+
List<String> findInterrogationIdByCollectionInstrumentIdAndProcessDateIsNull(String collectionInstrumentId);
2828

2929
}

0 commit comments

Comments
 (0)