def METHOD_NAME(self, *args, **kwargs):
    self._semaphore.acquire()
    try:
        return super().METHOD_NAME(*args, **kwargs)
    except psycopg2.pool.PoolError as e:
        if str(e) == "connection pool is closed":
            make_pool()
        raise e