Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: e850674765
Fetching contributors…

Cannot retrieve contributors at this time

27 lines (23 sloc) 0.885 kB
-module(boss_db_cache).
-export([handle_record_news/3, handle_collection_news/3]).
handle_record_news(_, _, {Prefix, Key}) ->
boss_cache:delete(Prefix, Key),
{ok, cancel_watch}.
handle_collection_news(deleted, _, {Prefix, Key}) ->
boss_cache:delete(Prefix, Key),
{ok, cancel_watch};
handle_collection_news(created, _, {Prefix, Key}) ->
boss_cache:delete(Prefix, Key),
{ok, cancel_watch};
handle_collection_news(updated, {_Record, Attr, _OldVal, _NewVal}, {Prefix, Key}) when Attr =:= element(5, Key) ->
boss_cache:delete(Prefix, Key),
{ok, cancel_watch};
handle_collection_news(updated, {_Record, Attr, _OldVal, _NewVal}, {Prefix, Key}) ->
Conditions = element(2, Key),
case proplists:lookup(Attr, Conditions) of
none ->
ok;
_ ->
boss_cache:delete(Prefix, Key),
{ok, cancel_watch}
end.
Jump to Line
Something went wrong with that request. Please try again.