Skip to content

Commit 983eb1f

Browse files
committed
cancel trigger is now always possible
1 parent e8f6b1c commit 983eb1f

File tree

6 files changed

+36
-20
lines changed

6 files changed

+36
-20
lines changed

CHANGELOG.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
# Changelog
22

3-
## v1.6.4 - (2025-03-19)
3+
## v1.6.5 - (2025-03-19)
4+
5+
- fixed correlation ID size
6+
- cancel can now always be triggered from the UI
7+
- showing slow used history
8+
9+
## v1.6.4 - (2025-03-18)
410

511
- in tests the task executor may finish a task before it returns it reference
612

7-
## v1.6.3 - (2025-03-19)
13+
## v1.6.3 - (2025-03-18)
814

915
- ensure the remove of a running trigger happens after it is added
1016

core/src/main/java/org/sterl/spring/persistent_tasks/api/task/RunningTriggerContextHolder.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,6 @@ public static String getCorrelationId() {
3737
public static String buildOrGetCorrelationId(String newCorrelationId) {
3838
var correlationId = getCorrelationId();
3939
if (correlationId == null) correlationId = newCorrelationId;
40-
// take over any key from the trigger before ...
41-
if (correlationId == null) {
42-
var c = getContext();
43-
if (c != null) correlationId = c.getKey().getId();
44-
}
4540
return correlationId;
4641
}
4742
}

core/src/main/java/org/sterl/spring/persistent_tasks/trigger/api/TriggerResource.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public PagedModel<Trigger> list(
4949
}
5050

5151
@PostMapping("triggers/{taskName}/{id}/run-at")
52-
public Optional<Trigger> cancelTrigger(
52+
public Optional<Trigger> setRunAt(
5353
@PathVariable("taskName") String taskName,
5454
@PathVariable("id") String id,
5555
@RequestBody OffsetDateTime runAt) {
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
2+
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
3+
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
4+
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
5+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
6+
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd
7+
http://www.liquibase.org/xml/ns/pro http://www.liquibase.org/xml/ns/pro/liquibase-pro-latest.xsd
8+
http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd">
9+
10+
<changeSet author="sterlp" id="2025-03-19-correlation-id-update">
11+
<modifyDataType tableName="pt_task_triggers" columnName="correlation_id" newDataType="varchar(200)" />
12+
<modifyDataType tableName="pt_trigger_history_details" columnName="correlation_id" newDataType="varchar(200)" />
13+
<modifyDataType tableName="pt_trigger_history_last_states" columnName="correlation_id" newDataType="varchar(200)" />
14+
</changeSet>
15+
</databaseChangeLog>

ui/src/scheduler/views/scheduler.view.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const SchedulerStatusView = ({ scheduler }: Props) => {
3232
return [
3333
...prev.slice(-10), // Keep only the last 14 entries
3434
{
35-
time: new Date().toLocaleTimeString(), // Format timestamp
35+
time: new Date(scheduler.lastPing).toLocaleTimeString(), // Format timestamp
3636
tasks: scheduler.runningTasks ?? 0, // Running tasks
3737
ping: scheduler.lastPing,
3838
},

ui/src/shared/view/trigger-list-item.view.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -87,19 +87,19 @@ const TriggerItemView = ({
8787
>
8888
Run now
8989
</Button>
90-
<Button
91-
variant="danger"
92-
onClick={() => {
93-
editTrigger
94-
.doCall("", "DELETE")
95-
.then(afterTriggerChanged)
96-
.catch((e) => console.info(e));
97-
}}
98-
>
99-
Cancel Trigger
100-
</Button>
10190
</>
10291
) : undefined}
92+
<Button
93+
variant="danger"
94+
onClick={() => {
95+
editTrigger
96+
.doCall("", "DELETE")
97+
.then(afterTriggerChanged)
98+
.catch((e) => console.info(e));
99+
}}
100+
>
101+
Cancel Trigger
102+
</Button>
103103
{showReRunButton ? (
104104
<Button
105105
variant="warning"

0 commit comments

Comments
 (0)