Skip to content

Commit 62a9831

Browse files
committed
clear timestamps on reset too
1 parent a4eefe6 commit 62a9831

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

resources/sample/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
<li><a href="index2.html">index 2</a></li>
55
</ul>
66

7-
<p>Author: <a href="mailto:test@example.org">Mr. Foo Bar</a>, more info <a href="subdir/foo.html">subdir/foo.html</a></p>
7+
<p>Author: <a href="mailto:test@example.org">Mr. Foo Bar</a>, more info <a href="subdir/foo.html">subdir/foo.html</a> | <a href="404.html">This is 404</a></p>
88
</body>
99
</html>

src/nl/melp/linkchecker/LinkChecker.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,12 +411,14 @@ public static void main(String[] rawArgs) throws InterruptedException, IOExcepti
411411

412412
Map<URI, Set<URI>> reverseLinks = new SerializedMappedSet<>(Serializers.of(URI.class), Serializers.of(URI.class), redis, prefixKeyName(".reverseLinks"));
413413
Map<String, Set<URI>> invalidUrls = new SerializedMappedSet<>(Serializers.of(String.class), Serializers.of(URI.class), redis, LinkChecker.class.getCanonicalName() + ".invalidUrls");
414+
Map<String, String> timestamps = new SerializedHashMap<>(Serializers.of(String.class), Serializers.of(String.class), redis, LinkChecker.class.getCanonicalName() + ".timestamps");
414415

415416
if (flags.contains("reset")) {
416417
urls.clear();
417418
results.clear();
418419
reverseLinks.clear();
419420
invalidUrls.clear();
421+
timestamps.clear();
420422
} else if (!flags.contains("no-recheck") && (flags.contains("resume") || flags.contains("recheck"))) {
421423
Set<URI> reset = new HashSet<>();
422424
logger.info("Scanning " + results.size() + " results for recheckable links");
@@ -493,7 +495,6 @@ public static void main(String[] rawArgs) throws InterruptedException, IOExcepti
493495
);
494496

495497
if (flags.contains("resume") || flags.contains("reset") || flags.contains("recheck")) {
496-
Map<String, String> timestamps = new SerializedHashMap<>(Serializers.of(String.class), Serializers.of(String.class), redis, LinkChecker.class.getCanonicalName() + ".timestamps");
497498
timestamps.remove("stop");
498499
if (flags.contains("reset")) {
499500
timestamps.put("start", ZonedDateTime.now(ZoneOffset.UTC).format(DateTimeFormatter.ISO_DATE_TIME));
@@ -533,6 +534,7 @@ public Integer deserialize(byte[] bytes) {
533534
}
534535
},
535536
redis, LinkChecker.class.getCanonicalName() + ".report.statuses");
537+
536538
SerializedHashMap<String, String> refers = new SerializedHashMap<>(
537539
stringSerializer,
538540
stringSerializer,

0 commit comments

Comments
 (0)