Skip to content

Commit

Permalink
clean code
Browse files Browse the repository at this point in the history
  • Loading branch information
tcm390 committed Feb 12, 2025
1 parent 64680fd commit c82be6c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
6 changes: 1 addition & 5 deletions packages/agent/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -350,11 +350,7 @@ async function findDatabaseAdapter(runtime: IAgentRuntime) {
let adapter: Adapter | undefined;
// if not found, default to sqlite
if (adapters.length === 0) {
const sqliteAdapterPlugin = await importWithRetry<any>(
'@elizaos-plugins/sqlite',
3,
1000
);
const sqliteAdapterPlugin = await importWithRetry<any>('@elizaos-plugins/sqlite');
const sqliteAdapterPluginDefault = sqliteAdapterPlugin.default;
adapter = sqliteAdapterPluginDefault.adapters[0];
if (!adapter) {
Expand Down
12 changes: 2 additions & 10 deletions packages/core/src/import.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,7 @@ export const dynamicImport = async (specifier: string) => {
if (module !== undefined) {
return module;
} else {
return await importWithRetry<any>(
specifier,
3,
1000
);
return await importWithRetry<any>(specifier);
}
};

Expand All @@ -53,11 +49,7 @@ export async function handlePluginImporting(plugins: string[]) {
const importedPlugins = await Promise.all(
plugins.map(async (plugin) => {
try {
const importedPlugin = await importWithRetry<any>(
plugin,
3,
1000
);
const importedPlugin = await importWithRetry<any>(plugin);
const functionName =
`${plugin
.replace("@elizaos/plugin-", "")
Expand Down

0 comments on commit c82be6c

Please sign in to comment.