Skip to content

Commit 9326a3b

Browse files
feat: function impl
1 parent b2fcfe9 commit 9326a3b

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

src/countly.cpp

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ void Countly::checkAndSendEventToRQ() {
520520

521521
void Countly::setMaxEvents(size_t value) {
522522
log(LogLevel::WARNING, "[Countly][setMaxEvents/SetMaxEventsPerMessage] These calls are deprecated. Use 'setEventsToRQThreshold' instead.");
523-
setEventsToRQThreshold(value);
523+
setEventsToRQThreshold(static_cast<int>(value));
524524
}
525525

526526
void Countly::setEventsToRQThreshold(int value) {
@@ -824,12 +824,24 @@ int Countly::checkEQSize() {
824824
return event_count;
825825
}
826826

827+
int Countly::checkRQSize() {
828+
log(LogLevel::DEBUG, "[Countly][checkRQSize]");
829+
int request_count = -1;
830+
if (!is_sdk_initialized) {
831+
log(LogLevel::DEBUG, "[Countly][checkRQSize] SDK is not initialized.");
832+
return request_count;
833+
}
834+
835+
request_count = static_cast<int>(requestModule->RQSize());
836+
return request_count;
837+
}
838+
827839
#ifndef COUNTLY_USE_SQLITE
828840
int Countly::checkMemoryEQSize() {
829841
log(LogLevel::DEBUG, "[Countly][checkMemoryEQSize] Checking event queue size in memory");
830842
int result = 0;
831843
mutex->lock();
832-
result = event_queue.size();
844+
result = static_cast<int>(event_queue.size());
833845
mutex->unlock();
834846
return result;
835847
}
@@ -1205,4 +1217,4 @@ void Countly::updateRemoteConfigExcept(std::string *keys, size_t key_count) {
12051217
std::thread _thread(&Countly::_updateRemoteConfigWithSpecificValues, this, data);
12061218
_thread.detach();
12071219
}
1208-
} // namespace cly
1220+
} // namespace cly

src/request_module.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,4 +341,5 @@ HTTPResponse RequestModule::sendHTTP(std::string path, std::string data) {
341341
return response;
342342
#endif
343343
}
344+
long long RequestModule::RQSize() { return impl->_storageModule->RQCount(); }
344345
} // namespace cly

0 commit comments

Comments
 (0)