fix: pipeline

This commit is contained in:
2023-05-31 15:30:25 +02:00
parent 68400f2480
commit 45444d9373
31 changed files with 74 additions and 120 deletions

View File

@@ -12,8 +12,7 @@
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <https://www.gnu.org/licenses/>.
*/
import {ConnectorClient} from '@openstapps/api/lib/connector-client.js';
import {HttpClient} from '@openstapps/api/lib/http-client.js';
import {ConnectorClient, HttpClient} from '@openstapps/api';
import {SCLicensePlate, SCNamespaces, SCThings} from '@openstapps/core';
import {Connector} from './connector.js';
@@ -48,9 +47,6 @@ export function createUUID(itemIdentifier: unknown, licensePlate: SCLicensePlate
export async function executeConnector<T extends SCThings>(backend: string, connector: Connector<T>) {
const items: T[] = await connector.getItems();
const client: ConnectorClient = new ConnectorClient(new HttpClient(), backend);
try {
await client.index<T>(items, connector.origin);
} catch (err) {
throw err;
}
// this might throw an error!
await client.index<T>(items, connector.origin);
}