only log custom policy path if we're actually using a script to load the policy

This commit is contained in:
Siddharth Singh 2025-03-30 14:28:13 +05:30
parent 7715d53ad5
commit 70dba0c66b
No known key found for this signature in database

View file

@ -53,15 +53,17 @@ export class PolicyWorker implements NPolicy {
path: conf.policy,
databaseUrl: conf.databaseUrl,
pubkey: await conf.signer.getPublicKey(),
mode: conf.policyMode
});
logi({
level: 'info',
ns: 'ditto.system.policy',
msg: 'Using custom policy',
path: conf.policy,
enabled: true,
});
if (conf.policyMode === "script") {
logi({
level: 'info',
ns: 'ditto.system.policy',
msg: 'Using custom policy',
path: conf.policy,
enabled: true,
});
}
} catch (e) {
if (e instanceof Error && e.message.includes('Module not found')) {
logi({