Skip to content
This repository was archived by the owner on May 29, 2021. It is now read-only.
This repository was archived by the owner on May 29, 2021. It is now read-only.

dailyUploadCount is not reset? #94

@st3fan

Description

@st3fan

I may be missing something here that is not obvious from the code, but I only see two functions that deal with the $PINGTYPE-dailyUploadCount value in Storage:

The first retrieves the value:

    private func dailyUploadCountForPingType(_ pingType: String) -> Int {
        return storage.get(valueFor: "\(pingType)-dailyUploadCount") as? Int ?? 0
    }

The second increments the value:

    private func incrementDailyUploadCountForPingType(_ pingType: String) {
        let dailyUploadCount = dailyUploadCountForPingType(pingType) + 1
        storage.set(key: "\(pingType)-dailyUploadCount", value: dailyUploadCount)
        
        let lastUploadTimestamp = Date().timeIntervalSince1970
        storage.set(key: "\(pingType)-lastUploadTimestamp", value: lastUploadTimestamp)
    }

Where is the code that resets or decrements this counter?

What happens when this counter reaches MaxNumberOfPingUploadsPerDay (100)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions