Skip to content

Commit

Permalink
nixos/librenms: enable optimizations and view-cache
Browse files Browse the repository at this point in the history
Enables optimizations and view cache for the librenms module.
Optimizations and view cache are both regenerated with each package
update.
  • Loading branch information
NetaliDev committed Dec 23, 2024
1 parent 5cd2444 commit 6abc69d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion nixos/modules/services/monitoring/librenms.nix
Original file line number Diff line number Diff line change
Expand Up @@ -603,10 +603,14 @@ in
''
)
+ ''
# clear cache after update
# clear cache after update and regenerate optimizations
OLD_VERSION=$(cat ${cfg.dataDir}/version)
if [[ $OLD_VERSION != "${package.version}" ]]; then
rm -r ${cfg.dataDir}/cache/*
${artisanWrapper}/bin/librenms-artisan view:clear
${artisanWrapper}/bin/librenms-artisan optimize:clear
${artisanWrapper}/bin/librenms-artisan view:cache
${artisanWrapper}/bin/librenms-artisan optimize
echo "${package.version}" > ${cfg.dataDir}/version
fi
Expand Down

0 comments on commit 6abc69d

Please sign in to comment.