aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-12-03 09:05:41 +0100
committerKim Alvefur <zash@zash.se>2021-12-03 09:05:41 +0100
commit8aa16eaec0ad9d66d3da9b453bf9159f8446ff2a (patch)
tree9f4bd9460d7e32aa0dcb8c21a3b9c354d9040797 /core
parentd6070eea1ff8629f8bd71578ea4288e552b9e2db (diff)
downloadprosody-8aa16eaec0ad9d66d3da9b453bf9159f8446ff2a.tar.gz
prosody-8aa16eaec0ad9d66d3da9b453bf9159f8446ff2a.zip
mod_cron: Add a 'weekly' job frequency
Diffstat (limited to 'core')
-rw-r--r--core/moduleapi.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/core/moduleapi.lua b/core/moduleapi.lua
index 82b1faf3..6a91a045 100644
--- a/core/moduleapi.lua
+++ b/core/moduleapi.lua
@@ -521,6 +521,11 @@ function api:daily(name, fun)
self:cron({ name = name; when = "daily"; run = fun });
end
+function api:weekly(name, fun)
+ if type(name) == "function" then fun, name = name, nil; end
+ self:cron({ name = name; when = "weekly"; run = fun });
+end
+
local path_sep = package.config:sub(1,1);
function api:get_directory()
return self.resource_path or self.path and (self.path:gsub("%"..path_sep.."[^"..path_sep.."]*$", "")) or nil;