View Source Glific.Erase (Glific v5.1.6)

A simple module to periodically delete old data to clean up db

Link to this section Summary

Functions

Keep latest 25 contact_history for a contact

Keep latest limited messages for a contact

Keep latest limited messages for a contact

Clean old records for table like notification and logs

Do the daily DB cleaner tasks

Do the weekly DB cleaner tasks, typically in the middle of the night on sunday morning

Link to this section Functions

Link to this function

clean_contact_histories()

View Source
@spec clean_contact_histories() :: any()

Keep latest 25 contact_history for a contact

Link to this function

clean_message_for_contact(contact_id, org_id, skip_delete \\ false)

View Source
@spec clean_message_for_contact(non_neg_integer(), non_neg_integer(), boolean()) ::
  :ok

Keep latest limited messages for a contact

Link to this function

clean_messages(org_id, skip_delete \\ false)

View Source
@spec clean_messages(non_neg_integer(), boolean()) :: list()

Keep latest limited messages for a contact

@spec clean_old_records() :: any()

Clean old records for table like notification and logs

@spec perform_daily() :: any()

Do the daily DB cleaner tasks

@spec perform_weekly() :: any()

Do the weekly DB cleaner tasks, typically in the middle of the night on sunday morning