Description
When I tested plugin local (better-sqlite), the plugins does not work. It seems to have problems with saving the metadata to the database with err message LibraryCheckService: Error trying to save libraries on database
.
Link to Reproduction
https://example.com
Steps to reproduce
Using the newest Version (Backend 0.1.0) of the plugin with Backstage 1.23.2.
// backend/src/index.ts
import libraryCheck from './plugins/libraryCheck';
// ...
const libraryCheckEnv = useHotMemoize(module, () =>
createEnv('libraryCheck'),
);
// ...
apiRouter.use('/library-check', await libraryCheck(libraryCheckEnv));
// backend/src/plugins/libraryCheck.ts
import { PluginEnvironment } from '../types';
import { Router } from 'express';
import {
DatabaseLibraryCheckStore,
createRouter,
} from '@anakz/backstage-plugin-library-check-backend';
export default async function createPlugin({
logger,
database,
config,
}: PluginEnvironment): Promise<Router> {
const db = await DatabaseLibraryCheckStore.create({
database: database,
});
return await createRouter({
logger,
database: db,
config,
});
}
// backend/src/plugins/catalog.ts
import {
LibraryCheckProcessor,
LibraryCheckProvider,
LibraryCheckUpdaterProcessor,
} from '@anakz/backstage-plugin-library-check-backend';
// ...
builder.addEntityProvider(
LibraryCheckProvider.fromConfig({
envId: 'production',
logger: env.logger,
discovery: env.discovery,
schedule: env.scheduler.createScheduledTaskRunner({
initialDelay: {
seconds: 30,
},
frequency: {
minutes: 60,
},
timeout: {
minutes: 1,
},
}),
}),
);
builder.addProcessor(
LibraryCheckProcessor.fromConfig(env.config, {
discoveryService: env.discovery,
reader: env.reader,
logger: env.logger,
}),
LibraryCheckUpdaterProcessor.fromConfig(env.config, {
discoveryService: env.discovery,
reader: env.reader,
logger: env.logger,
}),
);
// ...
Plugin Version
0.1.0
Browser
No response
Operating System
Additional Information
No response