Skip to content

Commit fd6123e

Browse files
authored
Revert "During migration, only look at new tickets instead of updated ones (#…" (#850)
This reverts commit de488fe.
1 parent de488fe commit fd6123e

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

src/main/kotlin/io/github/mojira/arisa/ExecutionTimeframe.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class ExecutionTimeframe(
4949
* Creates a JQL query for freshly updated issues.
5050
*/
5151
fun getFreshlyUpdatedJql() =
52-
"created > ${lastRunTime.toEpochMilli()}${capIfNotOpenEnded()}"
52+
"updated > ${lastRunTime.toEpochMilli()}${capIfNotOpenEnded()}"
5353

5454
/**
5555
* Creates a JQL query for issues which have been updated in the execution timeframe, shifted to the past
@@ -59,7 +59,7 @@ class ExecutionTimeframe(
5959
require(!offset.isNegative)
6060
val checkStart = lastRunTime.minus(offset)
6161
val checkEnd = currentRunTime.minus(offset)
62-
return "created > ${checkStart.toEpochMilli()} AND created <= ${checkEnd.toEpochMilli()}"
62+
return "updated > ${checkStart.toEpochMilli()} AND updated <= ${checkEnd.toEpochMilli()}"
6363
}
6464

6565
fun contains(instant: Instant): Boolean = instant in lastRunTime..currentRunTime
@@ -70,7 +70,7 @@ class ExecutionTimeframe(
7070
* @return If open ended: empty string. Otherwise: ` AND updated <= [currentRunTime]`
7171
*/
7272
private fun capIfNotOpenEnded(): String =
73-
if (openEnded) "" else " AND created <= ${currentRunTime.toEpochMilli()}"
73+
if (openEnded) "" else " AND updated <= ${currentRunTime.toEpochMilli()}"
7474

7575
override fun toString(): String {
7676
val formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")

src/test/kotlin/io/github/mojira/arisa/ExecutionTimeframeTest.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class ExecutionTimeframeTest : StringSpec({
2525
timeframe.lastRunTime shouldBe lastRunTime
2626
timeframe.currentRunTime.isAfter(Instant.now()) shouldBe false
2727
// Should not be capped
28-
timeframe.getFreshlyUpdatedJql() shouldNotContain " AND created <= "
28+
timeframe.getFreshlyUpdatedJql() shouldNotContain " AND updated <= "
2929

3030
val delayedStart = LocalDateTime.of(2021, 1, 1, 12, 0, 0)
3131
.atZone(ZoneOffset.UTC)
@@ -35,7 +35,7 @@ class ExecutionTimeframeTest : StringSpec({
3535
// Shift timeframe to start at `offsetBaseInstant`
3636
// Note: Cannot hardcode `delayedEnd` value in string because it depends on how fast
3737
// `ExecutionTimeframe.getTimeframeFromLastRun` executes
38-
timeframe.getDelayedUpdatedJql(offset) shouldBe "created > 1609502400000 AND created <= ${delayedEnd.toEpochMilli()}"
38+
timeframe.getDelayedUpdatedJql(offset) shouldBe "updated > 1609502400000 AND updated <= ${delayedEnd.toEpochMilli()}"
3939
}
4040

4141
"getTimeframeFromLastRun should return the correct timeframe if last run was a while ago" {
@@ -56,7 +56,7 @@ class ExecutionTimeframeTest : StringSpec({
5656

5757
timeframe.lastRunTime shouldBe lastRunTime
5858
timeframe.currentRunTime shouldBe timeframeEnd
59-
timeframe.getFreshlyUpdatedJql() shouldBe "created > 1609502400000 AND created <= 1609503000000"
60-
timeframe.getDelayedUpdatedJql(Duration.ofHours(1)) shouldBe "created > 1609498800000 AND created <= 1609499400000"
59+
timeframe.getFreshlyUpdatedJql() shouldBe "updated > 1609502400000 AND updated <= 1609503000000"
60+
timeframe.getDelayedUpdatedJql(Duration.ofHours(1)) shouldBe "updated > 1609498800000 AND updated <= 1609499400000"
6161
}
6262
})

0 commit comments

Comments
 (0)