diff options
| author | Andreas Köhler <andreas.koehler@1und1.de> | 2010-08-16 17:16:18 +0200 |
|---|---|---|
| committer | Badlop <badlop@process-one.net> | 2010-08-18 13:22:38 +0200 |
| commit | d6722e353f413dbccd936388b99c92652782dea9 (patch) | |
| tree | 1eeb4d1be648034c92ba6b3dfa164da24ce0323f /src | |
| parent | Fix gen_storage:matchrules_transform_conditions/2 for =/=, and, andalso, or a... (diff) | |
Fix mod_offline:remove_old_messages/1.
Diffstat (limited to 'src')
| -rw-r--r-- | src/mod_offline.erl | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/mod_offline.erl b/src/mod_offline.erl index 99834f04e..068f45c20 100644 --- a/src/mod_offline.erl +++ b/src/mod_offline.erl @@ -431,22 +431,21 @@ pop_offline_messages(Ls, User, Server) remove_expired_messages() -> TimeStamp = make_timestamp(), lists:foreach( - fun(Host) -> + fun(HostB) -> F = fun() -> gen_storage:delete_where( - Host, offline_msg, + HostB, offline_msg, [{'andalso', {'=/=', expire, 0}, {'<', expire, TimeStamp}}]) end, - gen_storage:transaction(Host, offline_msg, F) + gen_storage:transaction(HostB, offline_msg, F) end, gen_storage:all_table_hosts(offline_msg)). remove_old_messages(Days) -> Timestamp = make_timestamp() - 60 * 60 * 24 * Days, lists:foreach( - fun(Host) -> - HostB = list_to_binary(Host), + fun(HostB) -> F = fun() -> gen_storage:delete_where(HostB, offline_msg, [{'<', timestamp, Timestamp}]) |
