File tree Expand file tree Collapse file tree 3 files changed +12
-1
lines changed
Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Original file line number Diff line number Diff line change 1+ 21.11.1
2+ * ! Minor breaking change ! Default automatic session update duration changed to 60 seconds.
3+ * Added a call to change the automatic session update duration.
4+ * Fixed a bug where session duration was reported wrong.
5+
1621.11.0
27* Fixed session duration issue.
38* Added functionality to report event duration manually.
Original file line number Diff line number Diff line change @@ -207,6 +207,11 @@ class Countly {
207207
208208 addEvent (event);
209209 }
210+
211+ /* Provide 'updateInterval' in seconds. */
212+ inline void setAutomaticSessionUpdateInterval (unsigned short updateInterval) {
213+ _auto_session_update_interval = updateInterval;
214+ }
210215private:
211216 void log (LogLevel level, const std::string& message);
212217
@@ -236,6 +241,7 @@ class Countly {
236241 bool stop_thread;
237242 bool running;
238243 size_t wait_milliseconds;
244+ unsigned short _auto_session_update_interval = 60 ; // value is in seconds;
239245
240246 size_t max_events;
241247#ifndef COUNTLY_USE_SQLITE
Original file line number Diff line number Diff line change @@ -482,7 +482,7 @@ bool Countly::updateSession() {
482482 auto duration = std::chrono::duration_cast<std::chrono::seconds>(getSessionDuration ());
483483 mutex.lock ();
484484
485- if (duration.count () * 1000 >= COUNTLY_KEEPALIVE_INTERVAL ) {
485+ if (duration.count () >= _auto_session_update_interval ) {
486486 log (Countly::LogLevel::DEBUG, " [Countly][updateSession] sending session update." );
487487 std::map<std::string, std::string> data = {
488488 {" app_key" , session_params[" app_key" ].get <std::string>()},
You can’t perform that action at this time.
0 commit comments