Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

English - Español

Activity Cleanup for d9

A hook extension that automatically removes old activity records from the d9 database, helping keep your instance performant and free of unnecessary historical data.

Features

  • Automatically deletes activity entries older than a configurable threshold.
  • Lightweight background hook – minimal performance impact.
  • Easy to install and update.

Build

Clone the repository and build the extension:

git clone https://github.com/william-perez-dev/d9-activity-cleanup.git
cd d9-activity-cleanup
npm install
npm run build

Installation

  1. Create the required folder inside your d9 instance (if it doesn't already exist):
extensions/hooks/d9-activity-cleanup
  1. Copy the built file dist/index.cjs from this repository into that folder.
mkdir -p /path/to/your/d9-instance/extensions/hooks/d9-activity-cleanup
cp dist/index.cjs /path/to/your/d9-instance/extensions/hooks/d9-activity-cleanup/

Configuration

To enable and customize the activity cleanup behavior, add the following variables to your d9 instance .env file:

ACTIVITY_CLEANUP_ALLOWED=true           # false by default – enables the cleanup hook
ACTIVITY_CLEANUP_SCHEDULE='* 3 * * *'   # '0 0 * * *' by default (daily at midnight)
ACTIVITY_CLEANUP_RETENTION_DAYS=90      # 30 days by default – delete activities older than this
ACTIVITY_CLEANUP_BATCH_SIZE=1000        # 1000 by default – number of records deleted per batch

Licence

MIT License

About

A hook extension to automatically clean up old activity entries from d9 database.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages