Skip to content

Commit

Permalink
try with unified bool strings
Browse files Browse the repository at this point in the history
  • Loading branch information
FxKu committed Sep 12, 2024
1 parent 59e1fe2 commit f7f6ebe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion postgres-appliance/bootstrap/maybe_pg_upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
def tail_postgres_log(weekday):
logdir = os.environ.get('PGLOG', '/home/postgres/pgdata/pgroot/pg_log')
logfile = os.path.join(logdir, 'postgresql-{0}.csv'.format(weekday))
if os.getenv('LOG_SHIP_HOURLY'):
if os.getenv('LOG_SHIP_HOURLY') == 'true':
logfile = os.path.join(logdir, 'postgresql-{0}-{1}.csv'.format(weekday, datetime.datetime.today().hour))
return subprocess.check_output(['tail', '-n5', logfile]).decode('utf-8')

Expand Down
4 changes: 2 additions & 2 deletions postgres-appliance/scripts/configure_spilo.py
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ def get_placeholders(provider):
placeholders.setdefault('CLONE_TARGET_INCLUSIVE', True)

placeholders.setdefault('LOG_GROUP_BY_DATE', False)
placeholders.setdefault('LOG_SHIP_HOURLY', False)
placeholders.setdefault('LOG_SHIP_HOURLY', 'false')
placeholders.setdefault('LOG_SHIP_SCHEDULE', '1 0 * * *')
placeholders.setdefault('LOG_S3_BUCKET', '')
placeholders.setdefault('LOG_S3_ENDPOINT', '')
Expand Down Expand Up @@ -775,7 +775,7 @@ def write_log_environment(placeholders):

log_schedule = os.getenv('LOG_SHIP_SCHEDULE')
if '/' in log_schedule.split()[1]:
log_env['LOG_SHIP_HOURLY'] = True
log_env['LOG_SHIP_HOURLY'] = 'true'

log_s3_key += placeholders['instance_data']['id']
log_env['LOG_S3_KEY'] = log_s3_key
Expand Down

0 comments on commit f7f6ebe

Please sign in to comment.