def update_issue_filter_cache(key, filter_id): RedisService.delete_value(key) if str(filter_id) != "0": filter = IssueFilter.objects.get(int(filter_id)) if filter.FilterCacheString: for filter_item in eval(filter.FilterCacheString): RedisService.set_svalue(key, filter_item, 7 * 24 * 3600)
def cache_issue_filter(key, values): field_name = values.split(":")[0] old_filter = RedisService.get_svalue(key) for item in old_filter: filter_member = item if filter_member.startswith(field_name): RedisService.delete_smember(key, filter_member) RedisService.set_svalue(key, values, 7 * 24 * 3600)