File tree Expand file tree Collapse file tree 4 files changed +23
-5
lines changed
main/java/org/sterl/spring/persistent_tasks/api
test/java/org/sterl/spring/persistent_tasks/trigger
db/src/main/resources/spring-persistent-tasks/db Expand file tree Collapse file tree 4 files changed +23
-5
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,21 @@ Focus is the usage with spring boot and JPA.
88
99Secondary goal is to support [ Poor mans Workflow] ( https://github.com/sterlp/pmw )
1010
11+ # DBs for storage
12+
13+ ## Tested in the pipeline
14+
15+ - H2
16+ - azure-sql-edge (MSSQL)
17+
18+ ## Supported in theory
19+
20+ - MSSQL
21+ - mySQL
22+ - PostgreSQL
23+ - mySQL
24+ - MariaDB
25+
1126# Setup and Run a Task
1227
1328- [ JavaDoc] ( https://sterlp.github.io/spring-persistent-tasks/javadoc-core/org/sterl/spring/persistent_tasks/PersistentTaskService.html )
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ public record AddTriggerRequest<T extends Serializable>(
1414 OffsetDateTime runtAt ,
1515 int priority ) {
1616
17+ @ SuppressWarnings ("unchecked" )
1718 public TaskId <T > taskId () {
1819 return (TaskId <T >)key .toTaskId ();
1920 }
Original file line number Diff line number Diff line change @@ -127,10 +127,7 @@ void testRunSimpleTask() throws Exception {
127127 final var historyEntity = historyService .findLastKnownStatus (triggerKey ).get ();
128128 assertThat (historyEntity .getData ().getExecutionCount ()).isEqualTo (1 );
129129 assertThat (historyEntity .getData ().getEnd ()).isAfterOrEqualTo (historyEntity .getData ().getStart ());
130- assertThat (historyEntity .getData ().getRunningDurationInMs ())
131- .isEqualTo (Duration .between (
132- historyEntity .getData ().getStart (),
133- historyEntity .getData ().getEnd ()).toMillis ());
130+ assertThat (historyEntity .getData ().getRunningDurationInMs ()).isNotNull ();
134131 assertThat (historyEntity .getData ().getExecutionCount ()).isEqualTo (1 );
135132 asserts .assertValue ("foo" );
136133 asserts .assertMissing ("bar" );
@@ -197,6 +194,11 @@ void testFailedSavingException() throws Exception {
197194 void testFailedTriggerHasDuration () throws Exception {
198195 // GIVEN
199196 TaskId <String > task = taskService .<String >replace ("foo" , c -> {
197+ try {
198+ Thread .sleep (10 );
199+ } catch (InterruptedException e ) {
200+ throw new RuntimeException (e );
201+ }
200202 throw new IllegalArgumentException ("Nope! " + c );
201203 });
202204
Original file line number Diff line number Diff line change 88 http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd" >
99
1010 <!-- Define properties for database-specific types -->
11- <property name =" offsetdatetime.type" value =" datetimeoffset(2 )" dbms =" mssql" />
11+ <property name =" offsetdatetime.type" value =" datetimeoffset(6 )" dbms =" mssql" />
1212 <property name =" offsetdatetime.type" value =" TIMESTAMPTZ" dbms =" postgresql" />
1313 <property name =" offsetdatetime.type" value =" TIMESTAMP WITH TIME ZONE" dbms =" h2" />
1414 <property name =" offsetdatetime.type" value =" DATETIME(6)" dbms =" mysql,mariadb" />
You can’t perform that action at this time.
0 commit comments