Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@dummy
@transaction_retry
def create_without_context_manager(self):
session = self.db.get_session()
session.add(ExampleModel(data='created without context manager'))
session.commit()
@dummy
def write(self, key, value):
obj = ExampleModel(key=key, value=value)
self.db.session.add(obj)
self.db.session.commit()
@dummy
def list_subscribers(self):
return self.websocket_hub.subscriptions
@dummy
def entrypoint(self, arg):
return self.example_rpc.method(arg)
@dummy
def unicast(self, target_socket_id, value):
status = self.websocket_hub.unicast(target_socket_id, 'test_message', {
'value': value,
})
return status
@dummy(sensitive_arguments=['b[foo][1]'])
def method(self, a, b):
return {
"a": a,
"b": b
}
@dummy
def get_record_count_retry_inside(self):
with self.db.get_session() as session:
@transaction_retry(session=session)
def foo():
return session.query(ExampleModel).count()
return foo()
@dummy
def echo(self, arg):
return self.server_rpc.echo(arg)
@dummy
def broadcast(self, value):
self.websocket_hub.broadcast('test_channel', 'test_message', {
'value': value,
})
@dummy
def method(self, payload):
return self.publish(payload, routing_key=queue.name)