Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vacuum table for Papertrail Versions #655

Open
Quentinchampenois opened this issue Jan 13, 2025 · 0 comments
Open

Vacuum table for Papertrail Versions #655

Quentinchampenois opened this issue Jan 13, 2025 · 0 comments

Comments

@Quentinchampenois
Copy link
Contributor

Describe the bug
A clear and concise description of what the bug is.

Versions table is never cleaned up, add a VACUUM on the cleanup task

Example

In app/jobs/decidim/papertrail_versions_job.rb

    def perform(ret = nil)
    .....
      vacuum_table! if total.positive?

      log! "#{total} versions removed"
      
      end
      
      private
      
      def vacuum_table!
      log! "Running VACUUM on table 'versions'"
      sql = "VACUUM (FULL) versions;"
      ActiveRecord::Base.connection.execute(sql)
    end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant