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

Controlling cleanup #9

Open
darklow opened this issue Apr 14, 2014 · 1 comment
Open

Controlling cleanup #9

darklow opened this issue Apr 14, 2014 · 1 comment

Comments

@darklow
Copy link

darklow commented Apr 14, 2014

First of all thank you for such an awesome tool, it was very useful in our case!

I was wondering about cleaning up LocalStorage.
I noticed these variables in intercom.js

var THRESHOLD_TTL_EMIT = 50000;
var THRESHOLD_TTL_ONCE = 1000 * 3600;

Could you please explain how often currently cleanup happens and how these two variables differ?
And can we change these settings, to do it more often?
Thank you.

@pwolaq
Copy link

pwolaq commented Sep 1, 2016

Hi @darklow,

LocalStorage cleanups happen few miliseconds after every trigger method execution.

Here's how it works: script iterates over every messages that has been saved to localStorage and checks whether its timestamp is less than current time - threshold. If so, the message is removed from localStorage.

The difference between THRESHOLD_TTL_EMIT and THRESHOLD_TTL_ONCE is that the first one is used with emitting normal messages (stating interval after which message is removed) and the second is used with once to set ttl property if it's not passed as third argument.

Cheers,
Pawel

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