How to use the pgctl.errors.reraise function in pgctl

To help you get started, we’ve selected a few pgctl examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Yelp / pgctl / pgctl / service.py View on Github external
def handle_race(path):
        show_runaway_processes(path)
        if handle_race.limit > 0:
            handle_race.limit -= 1
        else:
            reraise(Impossible('lock is held, but not by any process, ten times'))
    handle_race.limit = 10
github Yelp / pgctl / pgctl / cli.py View on Github external
def on_lock_held(path):
            reraise(LockHeld(
                'another pgctl command is currently managing this service: (%s)\n%s' %
                (bestrelpath(path), ps(fuser(path)))
            ))