Skip to content

Commit 505a46b

Browse files
Change GH parser behavior to reset its cursor if not in update
mode. Again remove update mode from default behavior.
1 parent 8ba4954 commit 505a46b

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/main/java/eu/fasten/vulnerabilityproducer/VulnerabilityProducer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public void start(boolean updatesOnly, String inferStrategy) throws IOException
108108
while (true) {
109109
logger.info("Sleeping a day, see you in a bit");
110110
parserManager.sleep();
111-
parserManager.getVulnerabilitiesFromParsers(kafkaProducer, topic, true);
111+
parserManager.getVulnerabilitiesFromParsers(kafkaProducer, topic, updatesOnly);
112112
}
113113
}
114114

src/main/java/eu/fasten/vulnerabilityproducer/utils/parsers/GHParser.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,10 @@ public HashMap<String, Vulnerability> getVulnerabilities(boolean updatesOnly) {
186186
HashMap<String, Vulnerability> vulnerabilities = new HashMap<>();
187187
JSONHandler.GHResponse response = null;
188188

189-
// Step 1: Make the first request without any cursor.txt
189+
// Step 1: Reset the cursor if we are not updating only
190+
if(!updatesOnly) {
191+
this.cursor = null;
192+
}
190193
String queryWithoutCursor = buildQuery(this.cursor);
191194
var values = new HashMap<String, String>();
192195
values.put("query", queryWithoutCursor);

0 commit comments

Comments
 (0)