Skip to content

Commit

Permalink
fix merge
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisjenx committed Jan 15, 2025
1 parent a9ae977 commit 4a3ef64
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -206,23 +206,15 @@ class EntityQueries(
parameters = 1,
bindArgs = { bindString(entityName) }
))
<<<<<<< HEAD
when (entityKeys?.size) {
null, 0 -> {}

=======
when(entityKeys?.size) {
null, 0 -> {}
>>>>>>> origin/main
1 -> add(SqlQuery(
where = "entity_key = ?",
parameters = 1,
bindArgs = { bindString(entityKeys.first()) }
))
<<<<<<< HEAD

=======
>>>>>>> origin/main
else -> add(SqlQuery(
where = "entity_key IN (${entityKeys.joinToString(",") { "?" }})",
parameters = entityKeys.size,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,6 @@ open class KeyValueStorage<T : Any>(
* @see deleteExpired
*/
suspend fun deleteStale(
<<<<<<< HEAD
writeInstant: Instant? = Clock.System.now(),
readInstant: Instant? = Clock.System.now()
) = transaction {
Expand Down Expand Up @@ -438,16 +437,6 @@ open class KeyValueStorage<T : Any>(

else -> return@transaction
}
=======
writeInstant: Instant = Clock.System.now(),
readInstant: Instant = Clock.System.now()
) = transaction {
metadataQueries.purgeStale(
entity_name = entityName,
writeInstant = writeInstant.toEpochMilliseconds(),
readInstant = readInstant.toEpochMilliseconds()
)
>>>>>>> origin/main
updateWriteAt(
currentCoroutineContext()[RequestHash.Key]?.hash
?: (writeInstant.hashCode() + readInstant.hashCode())
Expand All @@ -464,11 +453,7 @@ open class KeyValueStorage<T : Any>(
*
* @see deleteExpired
*/
<<<<<<< HEAD
suspend fun deleteState(instant: Instant) {
=======
suspend fun deleteState(instant: Instant = Clock.System.now()) {
>>>>>>> origin/main
deleteStale(instant, instant)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,9 @@ DELETE FROM entity
WHERE entity_name = :entity_name
AND write_at < :writeInstant
AND (read_at IS NULL OR read_at < :readInstant);
<<<<<<< HEAD

purgeStaleWrite:
DELETE FROM entity WHERE entity_name = :entity_name AND write_at < :writeInstant;

purgeStaleRead:
DELETE FROM entity WHERE entity_name = :entity_name AND read_at < :readInstant;
=======
>>>>>>> origin/main

0 comments on commit 4a3ef64

Please sign in to comment.