Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jchris committed Sep 14, 2024
1 parent e7292d3 commit 25fdac2
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions src/blockstore/store-factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,13 @@ interface GatewayReady {
}
const onceGateway = new KeyedResolvOnce<GatewayReady>();
export async function getGatewayFromURL(url: URI, sthis: SuperThis): Promise<GatewayReady | undefined> {
// console.log("getGatewayFromURL", url.toString());
return onceGateway.get(url.toString()).once(async () => {
const item = storeFactory.get(url.protocol);
if (item) {
const ret = {
gateway: await item.gateway(sthis),
test: await item.test(sthis),
};
// console.log("getGatewayFromURL", url.toString());
const res = await ret.gateway.start(url);
if (res.isErr()) {
sthis.logger.Error().Result("start", res).Msg("start failed");
Expand Down Expand Up @@ -177,7 +175,6 @@ async function dataStoreFactory(loader: Loadable): Promise<DataStoreImpl> {

const onceMetaStoreFactory = new KeyedResolvOnce<MetaStoreImpl>();
async function metaStoreFactory(loader: Loadable): Promise<MetaStoreImpl> {
// console.log("metaStoreFactory.stores", loader.ebOpts.store.stores);
const url = ensureName(loader.name, buildURL(loader.ebOpts.store.stores?.meta, loader)).build().setParam("store", "meta").URI();
const sthis = ensureSuperLog(loader.sthis, "metaStoreFactory", { url: () => url.toString() });
return onceMetaStoreFactory.get(url.toString()).once(async () => {
Expand Down Expand Up @@ -242,7 +239,6 @@ async function remoteWalFactory(loader: Loadable): Promise<WALStoreImpl> {

export async function testStoreFactory(url: URI, sthis: SuperThis): Promise<TestGateway> {
sthis = ensureSuperLog(sthis, "testStoreFactory");
console.log("testStoreFactory", url.toString());
const gateway = await getGatewayFromURL(url, sthis);
if (!gateway) {
throw sthis.logger.Error().Url(url).Msg("gateway not found").AsError();
Expand Down

0 comments on commit 25fdac2

Please sign in to comment.