Skip to content

Commit 552a2fb

Browse files
committed
change how timestamp in created
1 parent 0cc966d commit 552a2fb

File tree

6 files changed

+22
-7
lines changed

6 files changed

+22
-7
lines changed

database/migration/src/main/resources/changesets/add_timestamp_in_call_caching.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<changeSet id="add_timestamp_in_call_caching" author="lmcnatt" dbms="mysql,hsqldb,mariadb,postgresql">
88
<addColumn tableName="CALL_CACHING_ENTRY">
9-
<column name="CREATED_AT" type="TIMESTAMP" defaultValueComputed="CURRENT_TIMESTAMP">
9+
<column name="CREATED_AT" type="TIMESTAMP">
1010
<constraints nullable="false" />
1111
</column>
1212
</addColumn>
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package cromwell.database.sql.tables
22

33
import java.sql.Timestamp
4-
import java.time.Instant
54

65
case class CallCachingEntry(
76
workflowExecutionUuid: String,
@@ -11,6 +10,5 @@ case class CallCachingEntry(
1110
returnCode: Option[Int],
1211
allowResultReuse: Boolean,
1312
callCachingEntryId: Option[Long] = None,
14-
// timestamp is set to time of CallCachingEntry creation by default
15-
createdAt: Timestamp = Timestamp.from(Instant.now())
13+
createdAt: Timestamp
1614
)

engine/src/main/scala/cromwell/engine/workflow/lifecycle/execution/callcaching/CallCache.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ import cromwell.engine.workflow.lifecycle.execution.callcaching.EngineJobHashing
1919
import cromwell.services.CallCaching.CallCachingEntryId
2020
import wom.core._
2121

22+
import java.sql.Timestamp
23+
import java.time.Instant
2224
import scala.concurrent.{ExecutionContext, Future}
2325

2426
/**
@@ -33,7 +35,8 @@ class CallCache(database: CallCachingSqlDatabase) {
3335
jobIndex = b.jobIndex.fromIndex,
3436
jobAttempt = b.jobAttempt,
3537
returnCode = b.returnCode,
36-
allowResultReuse = b.allowResultReuse
38+
allowResultReuse = b.allowResultReuse,
39+
createdAt = Timestamp.from(Instant.now())
3740
)
3841
val result = b.callOutputs.outputs.simplify
3942
val jobDetritus = b.jobDetritusFiles.getOrElse(Map.empty)

engine/src/test/scala/cromwell/engine/workflow/lifecycle/execution/callcaching/CallCachingSlickDatabaseSpec.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ import org.scalatest.matchers.should.Matchers
1515
import org.scalatest.prop.TableDrivenPropertyChecks
1616
import org.scalatest.time.{Millis, Seconds, Span}
1717

18+
import java.sql.Timestamp
19+
import java.time.Instant
1820
import scala.concurrent.ExecutionContext
1921

2022
class CallCachingSlickDatabaseSpec
@@ -58,7 +60,8 @@ class CallCachingSlickDatabaseSpec
5860
1,
5961
None,
6062
None,
61-
allowResultReuse = false
63+
allowResultReuse = false,
64+
createdAt = Timestamp.from(Instant.now())
6265
)
6366

6467
val callCachingHashEntriesA = Seq(

server/src/test/scala/cromwell/engine/workflow/lifecycle/execution/ejea/EjeaCheckingCacheEntryExistenceSpec.scala

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import cromwell.engine.workflow.tokens.JobTokenDispenserActor.JobTokenRequest
99
import cromwell.jobstore.JobStoreActor.RegisterJobCompleted
1010
import cromwell.services.metadata.MetadataService.PutMetadataAction
1111

12+
import java.sql.Timestamp
13+
import java.time.Instant
1214
import scala.util.control.NoStackTrace
1315

1416
class EjeaCheckingCacheEntryExistenceSpec extends EngineJobExecutionActorSpec {
@@ -20,7 +22,14 @@ class EjeaCheckingCacheEntryExistenceSpec extends EngineJobExecutionActorSpec {
2022
createCheckingCacheEntryExistenceEjea()
2123

2224
ejea ! CallCachingJoin(
23-
CallCachingEntry(helper.workflowId.toString, helper.jobFqn, 0, None, None, allowResultReuse = true),
25+
CallCachingEntry(helper.workflowId.toString,
26+
helper.jobFqn,
27+
0,
28+
None,
29+
None,
30+
allowResultReuse = true,
31+
createdAt = Timestamp.from(Instant.now())
32+
),
2433
List(CallCachingHashEntry("runtime attribute: docker", "HASHVALUE")),
2534
None,
2635
List.empty,

supportedBackends/google/batch/src/test/scala/cromwell/backend/google/batch/callcaching/BatchBackendCacheHitCopyingActorSpec.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ class BatchBackendCacheHitCopyingActorSpec
5454

5555
it should "do all the right things with blacklisting hits and buckets with groupings enabled" in {
5656

57+
// LM TODO add testing for max-result-age-days
58+
5759
val configString =
5860
"""
5961
|call-caching {

0 commit comments

Comments
 (0)