Skip to content

Commit

Permalink
Disable automatic publication
Browse files Browse the repository at this point in the history
  • Loading branch information
linas committed Oct 29, 2019
1 parent 84a94e5 commit 84a4942
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
12 changes: 7 additions & 5 deletions opencog/persist/ipfs/IPFSAtomStorage.cc
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,9 @@ void IPFSAtomStorage::resolve_atomspace(void)
if (0 == _key_cid.size()) return;

// Caution: as of this writing, name resolution takes
// exactly 60 seconds.
// exactly 60 seconds. This is a bug; see
// https://github.com/ipfs/go-ipfs/issues/3860
// for details.
std::string ipfs_path;
ipfs::Client* conn = conn_pool.pop();
conn->NameResolve(_key_cid, &ipfs_path);
Expand Down Expand Up @@ -271,15 +273,16 @@ ipfs::Json IPFSAtomStorage::get_atom_json(const Handle& atom)
}

/**
* Publish the AtomSpace CID to IPNS.
* Use IPNS to publish the latest IPFS cid for this AtomSpace.
*
* We run IPNS publication in it's own thread, because it's so
* horridly slow. As of this writing, either 60 sec or 90 sec.
* This is a well-known problem, see
* https://github.com/ipfs/go-ipfs/issues/3860
*/
void IPFSAtomStorage::publish(void)
void IPFSAtomStorage::publish_atomspace(void)
{
if (0 == _key_cid.size()) return;
_publish_cv.notify_one();
}

Expand Down Expand Up @@ -398,7 +401,7 @@ void IPFSAtomStorage::flushStoreQueue()
void IPFSAtomStorage::barrier()
{
flushStoreQueue();
publish();
// publish();
}

/* ================================================================ */
Expand Down Expand Up @@ -448,7 +451,6 @@ void IPFSAtomStorage::kill_data(void)

// Special case for TruthValues - must always have this atom.
do_store_single_atom(tvpred);
publish();
}

/* ================================================================ */
Expand Down
1 change: 0 additions & 1 deletion opencog/persist/ipfs/IPFSAtomStorage.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ class IPFSAtomStorage : public BackingStore
std::condition_variable _publish_cv;
bool _publish_keep_going;
static void publish_thread(IPFSAtomStorage*);
void publish(void);

// The Main IPNS key under which to publish the AtomSpace.
std::string _keyname;
Expand Down

0 comments on commit 84a4942

Please sign in to comment.