Skip to content

Commit

Permalink
Update LiteCore to 3.2.0-148 (#524)
Browse files Browse the repository at this point in the history
* Updated LiteCore to 3.2.0-148
* Generated replicator id as “CBL@<pointer address>”.
  • Loading branch information
pasin authored Mar 8, 2024
1 parent 3358d9d commit ad3669d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
13 changes: 11 additions & 2 deletions src/CBLReplicator_Internal.hh
Original file line number Diff line number Diff line change
Expand Up @@ -215,19 +215,27 @@ public:
// Encode replicator options dict:
alloc_slice options = encodeOptions();
params.optionsDictFleece = options;

// Generate replicator id for logging purpose:
std::stringstream ss;
ss << "CBLRepl@" << (void*)this;
auto replID = ss.str();
_replicatorID = alloc_slice(replID);

// Create the LiteCore replicator:
_db->useLocked([&](C4Database *c4db) {
#ifdef COUCHBASE_ENTERPRISE
if (_conf.endpoint->otherLocalDB()) {
_c4repl = c4db->newLocalReplicator(_conf.endpoint->otherLocalDB()->useLocked().get(),
params);
params,
_replicatorID);
} else
#endif
{
_c4repl = c4db->newReplicator(_conf.endpoint->remoteAddress(),
_conf.endpoint->remoteDatabaseName(),
params);
params,
_replicatorID);
}
});

Expand Down Expand Up @@ -542,6 +550,7 @@ private:
Retained<CBLDatabase> _db;
Retained<CBLCollection> _defaultCollection;
Retained<C4Replicator> _c4repl;
alloc_slice _replicatorID;
unique_ptr<CBLReplicatorStoppable> _stoppable;
ReplicationCollectionsMap _collections; // For filters and conflict resolver
bool _useInitialStatus; // For returning status before first start
Expand Down
2 changes: 1 addition & 1 deletion vendor/couchbase-lite-core

0 comments on commit ad3669d

Please sign in to comment.