fix: bump kotlinx-datetime to 0.7.1, scope ExperimentalTime opt-in to saveEvents
This commit is contained in:
@@ -7,7 +7,6 @@ import kotlin.time.ExperimentalTime
|
||||
import kotlinx.serialization.builtins.ListSerializer
|
||||
import kotlinx.serialization.json.Json
|
||||
|
||||
@OptIn(ExperimentalTime::class)
|
||||
class ScheduleCache(private val settings: Settings) {
|
||||
|
||||
private val json = Json { ignoreUnknownKeys = true }
|
||||
@@ -19,6 +18,7 @@ class ScheduleCache(private val settings: Settings) {
|
||||
private fun typeFilterKey(account: String) = "filters_typefilter_$account"
|
||||
private fun timestampKey(account: String) = "cached_events_timestamp_$account"
|
||||
|
||||
@OptIn(ExperimentalTime::class)
|
||||
fun saveEvents(account: String, events: List<Event>) {
|
||||
settings.putString(eventsKey(account), json.encodeToString(eventListSerializer, events))
|
||||
settings.putLong(timestampKey(account), Clock.System.now().toEpochMilliseconds())
|
||||
|
||||
Reference in New Issue
Block a user