mirror of
https://github.com/openflocon/Flocon.git
synced 2026-05-01 06:19:32 +00:00
feat: clean old sessions (#219)
Co-authored-by: Florent Champigny <florent@bere.al>
This commit is contained in:
parent
222b901833
commit
c954ef289e
12 changed files with 83 additions and 26 deletions
|
|
@ -96,6 +96,20 @@ interface FloconNetworkDao {
|
|||
callId: String,
|
||||
)
|
||||
|
||||
@Query(
|
||||
"""
|
||||
DELETE FROM FloconNetworkCallEntity
|
||||
WHERE deviceId = :deviceId
|
||||
AND packageName = :packageName
|
||||
AND appInstance != :appInstance
|
||||
""",
|
||||
)
|
||||
suspend fun deleteRequestOnDifferentSession(
|
||||
deviceId: String,
|
||||
packageName: String,
|
||||
appInstance: Long,
|
||||
)
|
||||
|
||||
@Query(
|
||||
"""
|
||||
DELETE FROM FloconNetworkCallEntity
|
||||
|
|
|
|||
|
|
@ -90,6 +90,16 @@ class NetworkLocalDataSourceRoom(
|
|||
)
|
||||
}
|
||||
|
||||
override suspend fun deleteRequestOnDifferentSession(
|
||||
deviceIdAndPackageName: DeviceIdAndPackageNameDomainModel,
|
||||
) {
|
||||
floconNetworkDao.deleteRequestOnDifferentSession(
|
||||
deviceId = deviceIdAndPackageName.deviceId,
|
||||
packageName = deviceIdAndPackageName.packageName,
|
||||
appInstance = deviceIdAndPackageName.appInstance
|
||||
)
|
||||
}
|
||||
|
||||
override suspend fun deleteRequestsBefore(
|
||||
deviceIdAndPackageName: DeviceIdAndPackageNameDomainModel,
|
||||
callId: String
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue