Skip to content

Commit

Permalink
added backward compatibility for older changes storage format
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomas-M committed Jul 31, 2023
1 parent d8f1bb4 commit 81c9c04
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion livekitlib
Original file line number Diff line number Diff line change
Expand Up @@ -693,8 +693,13 @@ persistent_changes()
# suffix for changes.dat based on final size, like 0, 00, 000 etc
SUFFIX=$(echo $((($PERCHSIZE + $SPLITSIZE - 1) / $SPLITSIZE)) | sed -r 's/./0/g')

# for backward compatibility, can be removed in 2025
if [ -e "$CHANGES/$PERCHFILE.$SUFFIX" -a ! -e "$CHANGES/$PERCHFILE" ]; then
dd if="$CHANGES/$PERCHFILE.$SUFFIX" of="$CHANGES/$PERCHFILE" bs=4k count=1
fi

# restore or use new
if [ -e "$CHANGES/$PERCHFILE.$SUFFIX" ]; then
if [ -e "$CHANGES/$PERCHFILE" ]; then
echo "* Restoring persistent changes from $PERCHFILE"
EXISTS="true"
else
Expand Down

0 comments on commit 81c9c04

Please sign in to comment.