diff --git a/opencog/persist/ipfs/IPFSAtomStorage.cc b/opencog/persist/ipfs/IPFSAtomStorage.cc index 21238f0..ece09e1 100644 --- a/opencog/persist/ipfs/IPFSAtomStorage.cc +++ b/opencog/persist/ipfs/IPFSAtomStorage.cc @@ -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); @@ -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(); } @@ -398,7 +401,7 @@ void IPFSAtomStorage::flushStoreQueue() void IPFSAtomStorage::barrier() { flushStoreQueue(); - publish(); + // publish(); } /* ================================================================ */ @@ -448,7 +451,6 @@ void IPFSAtomStorage::kill_data(void) // Special case for TruthValues - must always have this atom. do_store_single_atom(tvpred); - publish(); } /* ================================================================ */ diff --git a/opencog/persist/ipfs/IPFSAtomStorage.h b/opencog/persist/ipfs/IPFSAtomStorage.h index 6dcb068..cf1fcc2 100644 --- a/opencog/persist/ipfs/IPFSAtomStorage.h +++ b/opencog/persist/ipfs/IPFSAtomStorage.h @@ -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;