diff --git a/actors.mjs b/actors.mjs index 1c9609e..dfdf966 100644 --- a/actors.mjs +++ b/actors.mjs @@ -141,7 +141,7 @@ function mergeMainProfile(profile, mainProfile) { return mergedProfile; } -export async function interpolateProfiles(actorIdsOrNames, context) { +export async function interpolateProfiles(actorIdsOrNames, context, options = {}) { const profiles = await fetchProfiles(actorIdsOrNames, context); const profilesByActorId = profiles.reduce((acc, profile) => ({ @@ -303,5 +303,7 @@ export async function interpolateProfiles(actorIdsOrNames, context) { .then(transaction.commit) .catch(transaction.rollback); - await context.knex.schema.refreshMaterializedView('actors_meta'); + if (options.refreshView) { + await context.knex.schema.refreshMaterializedView('actors_meta'); + } }