Issue
We would like to enable real-time antivirus scanning for uploaded files but disable asynchronous background scanning of the document library. The issue arises because:
- Enabling
dl.store.antivirus.enabled=true
triggers both real-time scanning and background scanning of the document library. - Disabling
dl.store.antivirus.enabled=false
stops the real-time scanning on uploads but prevents background scans entirely.
Environment
- 2024.Q3.2
Resolution
Currently, Liferay does not provide an out-of-the-box (OOTB) option to completely disable the asynchronous background scan while keeping real-time upload scanning enabled. However, you can use the following workaround and set a long interval for background scans:
-
Navigate to Control Panel > System Settings > Antivirus > Asynchronous Antivirus Configuration, and set the Batch Scan Cron Expression to an extremely long interval, such as:
0 0 1 1 * ? 2099
This schedules the background scan to run once on January 1, 2099. -
Enable Real-Time Scanning:
Setdl.store.antivirus.enabled
totrue
in order to maintain real-time scanning of uploaded files. -
Test and Monitor:
Test the configuration in a non-production environment and monitor the logs to confirm no unexpected issues arise.