MCPcopy
hub / github.com/celery/celery / reconnect

Method reconnect

celery/bin/amqp.py:45–58  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

43 self.cli_context.echo(self.cli_context.OK)
44
45 def reconnect(self):
46 if self.connection:
47 self.connection.close()
48 else:
49 self.connection = self.cli_context.app.connection()
50
51 self.cli_context.echo(f'-> connecting to {self.connection.as_uri()}.')
52 try:
53 self.connection.connect()
54 except (ConnectionRefusedError, ConnectionResetError) as e:
55 self.echo_error(e)
56 else:
57 self.cli_context.secho('-> connected.', fg='green', bold=True)
58 self.channel = self.connection.default_channel
59
60
61@click.group(invoke_without_command=True)

Callers 10

__init__Method · 0.95
exchange_declareFunction · 0.80
exchange_deleteFunction · 0.80
queue_bindFunction · 0.80
queue_declareFunction · 0.80
queue_deleteFunction · 0.80
queue_purgeFunction · 0.80
basic_getFunction · 0.80
basic_publishFunction · 0.80
basic_ackFunction · 0.80

Calls 7

echo_errorMethod · 0.95
echoMethod · 0.80
sechoMethod · 0.80
closeMethod · 0.45
connectionMethod · 0.45
as_uriMethod · 0.45
connectMethod · 0.45

Tested by

no test coverage detected