Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions LaunchDarkly/LaunchDarkly/Models/LDConfig.swift
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,8 @@ public struct LDConfig {
/// The default maximum number of bytes of events the SDK can persist, for all environments together. (20 MiB)
static let eventCapacityBytes = 20 * 1024 * 1024

/// The default maximum age of persisted events. (7 days)
static let eventMaxAge: TimeInterval = 7 * 24 * 60 * 60
/// The default maximum age of persisted events. (24 hours)
static let eventMaxAge: TimeInterval = 24 * 60 * 60

/// The default behavior for the SDK is to keep events in memory only.
static let eventPersistence = EventPersistence.disabled
Expand Down Expand Up @@ -402,7 +402,7 @@ public struct LDConfig {

/// How long the SDK keeps events it has persisted but not yet reported, where `eventPersistence` keeps events across launches. Events
/// older than this are discarded rather than reported, and so is everything the SDK stored for an environment whose mobile key the
/// application stopped using. A value of zero or less means the default. (Default: 7 days)
/// application stopped using. A value of zero or less means the default. (Default: 24 hours)
///
/// It has no effect where `eventPersistence` is `.disabled`.
public var eventMaxAge: TimeInterval = Defaults.eventMaxAge
Expand Down
2 changes: 1 addition & 1 deletion LaunchDarkly/LaunchDarkly/ObjectiveC/ObjcLDConfig.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public final class ObjcLDConfig: NSObject {
set { config.eventCapacityBytes = newValue }
}

/// How long the SDK keeps persisted events it has not yet reported before discarding them, which also removes what it stored for a mobile key the application stopped using. No effect where `eventPersistence` is `.disabled`. (Default: 7 days)
/// How long the SDK keeps persisted events it has not yet reported before discarding them, which also removes what it stored for a mobile key the application stopped using. No effect where `eventPersistence` is `.disabled`. (Default: 24 hours)
@objc public var eventMaxAge: TimeInterval {
get { config.eventMaxAge }
set { config.eventMaxAge = newValue }
Expand Down
2 changes: 1 addition & 1 deletion LaunchDarkly/LaunchDarklyTests/Models/LDConfigSpec.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ final class LDConfigSpec: XCTestCase {
XCTAssertEqual(config.eventCapacity, LDConfig.Defaults.eventCapacity)
XCTAssertEqual(config.eventPersistence, LDConfig.Defaults.eventPersistence)
XCTAssertEqual(config.eventCapacityBytes, 20 * 1024 * 1024)
XCTAssertEqual(config.eventMaxAge, 7 * 24 * 60 * 60)
XCTAssertEqual(config.eventMaxAge, 24 * 60 * 60)
XCTAssertEqual(config.eventDeliveryDelay, 2)
XCTAssertEqual(config.connectionTimeout, LDConfig.Defaults.connectionTimeout)
XCTAssertEqual(config.eventFlushInterval, LDConfig.Defaults.eventFlushInterval)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1915,7 +1915,7 @@ final class EventStoreSpec: QuickSpec {
it("keeps a batch younger than the maximum age") {
_ = store.stage(EventStoreSpec.payload("recent"))
_ = store.closeBatch()
try EventStoreSpec.age(try EventStoreSpec.onlyBatchFile(in: store), byDays: 6)
try EventStoreSpec.age(try EventStoreSpec.onlyBatchFile(in: store), byDays: 0.5)

expect(store.discardExpired()) == 0
expect(store.pendingBatches().count) == 1
Expand Down Expand Up @@ -1987,7 +1987,7 @@ final class EventStoreSpec: QuickSpec {
let old = logLeftBy("gone")
let young = logLeftBy("recent")
try EventStoreSpec.age(old, byDays: 8)
try EventStoreSpec.age(young, byDays: 1)
try EventStoreSpec.age(young, byDays: 0.5)

expect(store.discardExpired()) == 1

Expand Down Expand Up @@ -2030,7 +2030,7 @@ final class EventStoreSpec: QuickSpec {
let inUse = try EventStoreSpec.environment("app.in-use", in: root, events: 1)
let otherApplication = try EventStoreSpec.environment("other.abandoned", in: root, events: 1)
try EventStoreSpec.age(contentsOf: abandoned, byDays: 8)
try EventStoreSpec.age(contentsOf: inUse, byDays: 1)
try EventStoreSpec.age(contentsOf: inUse, byDays: 0.5)
try EventStoreSpec.age(contentsOf: otherApplication, byDays: 30)

expect(store.discardExpired()) == 2
Expand Down
Loading