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

Add command for packing the ZODB [6.0.x] #180

Merged
merged 5 commits into from
Mar 6, 2025
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/104.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Provide command to pack ZODB. @erral
8 changes: 8 additions & 0 deletions skeleton/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,14 @@ elif [[ "$1" == "run" ]]; then
exec $sudo $VENVBIN/zconsole run etc/${CONF} "${@:2}"
elif [[ "$1" == "addzopeuser" ]]; then
exec $sudo $VENVBIN/addzopeuser -c etc/${CONF} "${@:2}"
elif [[ "$1" == "pack" ]]; then
if [[ -v ZEO_ADDRESS ]]; then
exec $sudo $VENVBIN/zeopack -d "${2:-0}" ${ZEO_ADDRESS}
elif [[ -v RELSTORAGE_DSN ]]; then
exec $sudo $VENVBIN/zodbpack -d "${2:-0}" etc/relstorage_pack.conf
else
exec $sudo $VENVBIN/zconsole run etc/${CONF} /app/scripts/pack.py
fi
else
# Custom
exec "$@"
Expand Down
6 changes: 6 additions & 0 deletions skeleton/etc/relstorage_pack.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<relstorage>
pack-gc true
<postgresql>
dsn $(RELSTORAGE_DSN)
</postgresql>
</relstorage>
2 changes: 2 additions & 0 deletions skeleton/scripts/pack.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from Zope2 import DB
DB.pack()