# HG changeset patch # User Kim Alvefur # Date 1553268653 -3600 # Node ID dafe1b5448226b417954fa80ff97686731ec55f6 # Parent 6bd65bff03b5644d4172b6ae170856fa27337558 mod_storage_sql: No archive item limit by default diff -r 6bd65bff03b5 -r dafe1b544822 plugins/mod_storage_sql.lua --- a/plugins/mod_storage_sql.lua Fri Mar 22 02:24:48 2019 +0100 +++ b/plugins/mod_storage_sql.lua Fri Mar 22 16:30:53 2019 +0100 @@ -150,7 +150,7 @@ --- Archive store API -local archive_item_limit = module:get_option_number("storage_archive_item_limit", 1000); +local archive_item_limit = module:get_option_number("storage_archive_item_limit"); local archive_item_count_cache = cache.new(module:get_option("storage_archive_item_limit_cache_size", 1000)); -- luacheck: ignore 512 431/user 431/store @@ -261,9 +261,11 @@ archive_item_count_cache:set(cache_key, item_count); end - module:log("debug", "%s has %d items out of %d limit", username, item_count, archive_item_limit); - if item_count >= archive_item_limit then - return nil, "quota-limit"; + if archive_item_limit then + module:log("debug", "%s has %d items out of %d limit", username, item_count, archive_item_limit); + if item_count >= archive_item_limit then + return nil, "quota-limit"; + end end when = when or os.time();