Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why does the function PendingUpload unsent events #112

Closed
arlyxiao opened this issue Sep 29, 2024 · 1 comment
Closed

Why does the function PendingUpload unsent events #112

arlyxiao opened this issue Sep 29, 2024 · 1 comment
Assignees

Comments

@arlyxiao
Copy link

arlyxiao commented Sep 29, 2024

The function PendingUpload will be called when initialized analytics. And then remove the file without sending the events.

1727580004498

Why not send the events when initialize analytics?
If it only removes files without sending events. These events will be lost.
This doesn't make sense.

In my use case,
It should flush all old temporary before purge whatever the scenario is.

@wenxi-zeng
Copy link
Contributor

wenxi-zeng commented Sep 30, 2024

hi @arlyxiao, these two functions PendingUploads and PurgeStorage are utility functions for people who wanna control the storage themselves. the SDK itself does not use these two functions for flush. if you want to flush the events before purge, simple do

    analytics.Flush();  // flush events
    analytics.PurgeStorage();  // remove damaged files that can't be flushed

the functions only do what it intends to do. Flush for flushing. Purge for cleaning.

if you want to flush at app launch, see this StartupPolicy for example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants