Skip to content

Commit

Permalink
Updating Config Section
Browse files Browse the repository at this point in the history
  • Loading branch information
AliRKat committed Oct 1, 2024
1 parent ce59d66 commit f370c78
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
8 changes: 3 additions & 5 deletions lib/countly-bulk.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ var BulkUser = require("./countly-bulk-user");
var CountlyStorage = require("./countly-storage");

const StorageTypes = cc.storageTypeEnums;
var storageType = StorageTypes.FILE;

/**
* @lends module:lib/countly-bulk
Expand Down Expand Up @@ -76,6 +75,7 @@ function CountlyBulk(conf) {
var maxBreadcrumbCount = 100;
var maxStackTraceLinesPerThread = 30;
var maxStackTraceLineLength = 200;
var storageType = StorageTypes.FILE;

cc.debugBulk = conf.debug || false;
if (!conf.app_key) {
Expand Down Expand Up @@ -105,11 +105,9 @@ function CountlyBulk(conf) {
conf.maxBreadcrumbCount = conf.max_breadcrumb_count || maxBreadcrumbCount;
conf.maxStackTraceLinesPerThread = conf.max_stack_trace_lines_per_thread || maxStackTraceLinesPerThread;
conf.maxStackTraceLineLength = conf.max_stack_trace_line_length || maxStackTraceLineLength;
conf.storage_type = conf.storage_type || storageType;

if (!conf.storage_type) {
storageType = conf.storage_type;
}
CountlyStorage.initStorage(conf.storage_path, storageType, true, conf.persist_queue);
CountlyStorage.initStorage(conf.storage_path, conf.storage_type, true, conf.persist_queue);

this.conf = conf;
/**
Expand Down
11 changes: 3 additions & 8 deletions lib/countly.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ var CountlyStorage = require("./countly-storage");

var Countly = {};
const StorageTypes = cc.storageTypeEnums;
var storageType = StorageTypes.FILE;

Countly.Bulk = Bulk;
(function() {
Expand Down Expand Up @@ -73,7 +72,7 @@ Countly.Bulk = Bulk;
var maxStackTraceLinesPerThread = 30;
var maxStackTraceLineLength = 200;
var deviceIdType = null;

var storageType = StorageTypes.FILE;
/**
* Array with list of available features that you can require consent for
*/
Expand Down Expand Up @@ -169,15 +168,11 @@ Countly.Bulk = Bulk;
Countly.maxBreadcrumbCount = conf.max_breadcrumb_count || Countly.max_breadcrumb_count || conf.max_logs || Countly.max_logs || maxBreadcrumbCount;
Countly.maxStackTraceLinesPerThread = conf.max_stack_trace_lines_per_thread || Countly.max_stack_trace_lines_per_thread || maxStackTraceLinesPerThread;
Countly.maxStackTraceLineLength = conf.max_stack_trace_line_length || Countly.max_stack_trace_line_length || maxStackTraceLineLength;

conf.storage_type = conf.storage_type || storageType;
// Common module debug value is set to init time debug value
cc.debug = conf.debug;

// Set the storage method and path
if (!conf.storage_type) {
storageType = conf.storage_type;
}
CountlyStorage.initStorage(conf.storage_path, storageType);
CountlyStorage.initStorage(conf.storage_path, conf.storage_type);

// clear stored device ID if flag is set
if (conf.clear_stored_device_id) {
Expand Down

0 comments on commit f370c78

Please sign in to comment.