-int
-cache_delete_task(bool query, size_t *size)
-{
- dispatch_sync(work_queue, ^{
- asl_out_module_t *mod, *m;
- asl_out_dst_data_t opts;
- size_t total_size = 0;
-
- memset(&opts, 0, sizeof(opts));
- if ((!query) && (size != NULL)) opts.all_max = *size;
-
- debug_log(ASL_LEVEL_NOTICE, "cache_delete_process%s size %lu\n", query ? " query" : "", opts.all_max);
-
- mod = asl_out_module_init();
-
- for (m = mod; m != NULL; m = m->next)
- {
- bool logged = false;
- asl_out_rule_t *r;
-
- for (r = m->ruleset; r != NULL; r = r->next)
- {
- if (r->action == ACTION_OUT_DEST)
- {
- if (r->dst->flags & MODULE_FLAG_ACTIVITY)
- {
- if (!logged)
- {
- debug_log(ASL_LEVEL_NOTICE, "----------------------------------------\n");
- debug_log(ASL_LEVEL_NOTICE, "Processing activity module %s\n", (m->name == NULL) ? "asl.conf" : m->name);
- logged = true;
- }
-
- size_t dsize = 0;
- module_check_size(r->dst, &opts, false, &dsize);
- total_size += dsize;
- }
- }
- }
-
- if (logged) debug_log(ASL_LEVEL_NOTICE, "Finished processing activity module %s\n", (m->name == NULL) ? "asl.conf" : m->name);
- }
-
- asl_out_module_free(mod);
-
- if (size != NULL) *size = total_size;
- });
-
- return 0;
-}
-