Skip to content

Commit

Permalink
clear imported whatsapp sessions
Browse files Browse the repository at this point in the history
  • Loading branch information
allgood committed Oct 5, 2024
1 parent 4fbec54 commit 68cd1bb
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions backend/scripts/load-retrieved.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,15 @@ for input_file in "$INPUT_DIR"/*.csv; do
echo "Error importing data from $input_file into table '$table'."
fi
done

echo "Clearing Whatsapp Sessions"
PGPASSWORD="${DB_PASS}" psql -h "${DB_HOST}" -U "${DB_USER}" -d "${DB_NAME}" -c "UPDATE \"Whatsapps\" SET session='', status='CLOSED'" &> /tmp/clearwhatsapps.log

if [ $? -gt 0 ]; then
echo "Error clearing Whatsapp sessions:"
cat /tmp/clearwhatsapps.log
exit 100
fi


exit 1

0 comments on commit 68cd1bb

Please sign in to comment.