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

Draft: #645 added run_at_timezone field to chain and add_job #646 #1

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

gaslitbytech
Copy link
Owner

@gaslitbytech gaslitbytech commented Mar 25, 2024

Continuing on from cybertec-postgresql#646 in my own fork.

Added new run_at_timezone field to the chain table to allow for optional separate time zone per chain. The default of current_setting('timezone)` will make this change backwards compatible.

Todo:

  • add unit tests. I haven't figured out how to run the unit tests locally yet. Use the following to start postgres in docker before letting vscode run the unit tests in the _test.go files.
#!/usr/bin/env bash
set -euo pipefail # Exit with nonzero exit code if anything fails
set -x # Display commands and their arguments as they are executed.

docker rm -f postgres-pg-timetable-test || true
docker run --rm --name postgres-pg-timetable-test \
-p 5432:5432 \
-e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=mysecretpassword \
--add-host host.docker.internal:host-gateway \
--net host \
-d postgres:16.2

timeout 90s /usr/bin/env bash -c "until docker exec postgres-pg-timetable-test pg_isready ; do sleep 5 ; done" # wait for db to be ready
docker exec postgres-pg-timetable-test psql -U postgres -c "CREATE USER scheduler PASSWORD 'somestrong';"
docker exec postgres-pg-timetable-test psql -U postgres -c "CREATE DATABASE timetable OWNER scheduler;"
docker exec postgres-pg-timetable-test psql -U postgres -c "SELECT version();"
docker logs -f postgres-pg-timetable-test
  • test migrations.
  • add docs

@gaslitbytech gaslitbytech self-assigned this Mar 29, 2024
@gaslitbytech gaslitbytech changed the title Draft: #645 added run_at_time_zone field to chain and add_job #646 Draft: #645 added run_at_timezone field to chain and add_job #646 Mar 30, 2024
@gaslitbytech gaslitbytech changed the title Draft: #645 added run_at_timezone field to chain and add_job #646 #645 added run_at_timezone field to chain and add_job #646 Apr 6, 2024
@gaslitbytech gaslitbytech changed the title #645 added run_at_timezone field to chain and add_job #646 Draft: #645 added run_at_timezone field to chain and add_job #646 Apr 6, 2024
@gaslitbytech gaslitbytech force-pushed the 645-add-time-zone-per-chain branch from aa0a713 to 807b5bd Compare June 15, 2024 02:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant