Skip to content

Commit b54258b

Browse files
authored
Update README.md
1 parent 046be1f commit b54258b

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,25 @@ let api = new ParseServer({
527527
528528
### Notes <!-- omit in toc -->
529529
530-
- This feature is currently only available for MongoDB and not for Postgres.
530+
- There are no additional steps needed to use this feature with MongoDB
531+
- For Postgres, you will need to create a cron job, use [pgAdmin](https://www.pgadmin.org/docs/pgadmin4/development/pgagent_jobs.html), or similar to call the Postgres function, `idempodency_delete_old_rows()`. For example, the cron job can call the script below (make sure the script has the same priveledges to log into Postgres as your Parse Server):
532+
533+
```bash
534+
#!/bin/bash
535+
536+
set -e
537+
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
538+
SELECT idempodency_delete_old_rows();
539+
EOSQL
540+
541+
exec "$@"
542+
```
543+
544+
Assuming the script above is named, `parse_idempodency_delete_old_rows.sh`, a cron job that runs the script every 2 minutes may look like:
545+
546+
```bash
547+
2 * * * * /root/parse_idempodency_delete_old_rows.sh >/dev/null 2>&1
548+
```
531549
532550
## Localization
533551

0 commit comments

Comments
 (0)