MCPcopy
hub / github.com/celery/celery / _index

Method _index

celery/backends/elasticsearch.py:147–165  ·  view source on GitHub ↗
(self, id, body, **kwargs)

Source from the content-addressed store, hash-verified

145 return self._set_with_state(key, value, None)
146
147 def _index(self, id, body, **kwargs):
148 body = {bytes_to_str(k): v for k, v in body.items()}
149 if self.doc_type:
150 return self.server.index(
151 id=bytes_to_str(id),
152 index=self.index,
153 doc_type=self.doc_type,
154 body=body,
155 params={'op_type': 'create'},
156 **kwargs
157 )
158 else:
159 return self.server.index(
160 id=bytes_to_str(id),
161 index=self.index,
162 body=body,
163 params={'op_type': 'create'},
164 **kwargs
165 )
166
167 def _update(self, id, body, state, **kwargs):
168 """Update state in a conflict free manner.

Callers 5

test_indexMethod · 0.95
test_index_bytes_keyMethod · 0.95
_set_with_stateMethod · 0.95
_updateMethod · 0.95

Calls 1

itemsMethod · 0.45

Tested by 3

test_indexMethod · 0.76
test_index_bytes_keyMethod · 0.76