mirror of
https://github.com/corda/corda.git
synced 2025-02-05 18:49:14 +00:00
moved init of simpleDateFormat
This commit is contained in:
parent
6d2608d693
commit
a320c8a116
@ -36,6 +36,7 @@ class RunOnceService(private val database: CordaPersistence, private val machine
|
||||
|
||||
private val log = loggerFor<RunOnceService>()
|
||||
private val running = AtomicBoolean(false)
|
||||
private val simpleDateFormat = SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS")
|
||||
|
||||
init {
|
||||
if (waitInterval <= updateInterval) {
|
||||
@ -129,7 +130,6 @@ class RunOnceService(private val database: CordaPersistence, private val machine
|
||||
}
|
||||
|
||||
private fun updateTimestamp(session: Session, mutualExclusion: MutualExclusion): Boolean {
|
||||
val simpleDateFormat = SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS")
|
||||
val minWaitTime = simpleDateFormat.format(Date(mutualExclusion.timestamp!!.time + waitInterval))
|
||||
val query = session.createNativeQuery("UPDATE $TABLE SET $MACHINE_NAME = :machineName, $TIMESTAMP = CURRENT_TIMESTAMP, $PID = :pid " +
|
||||
"WHERE $ID = 'X' AND " +
|
||||
|
Loading…
x
Reference in New Issue
Block a user