put a repo object Note: when doing calls with wait=False this gets async and caller must deal with async results / exceptions later.
(self, id, data, wait=True)
| 486 | yield self.get(id_, read_data=read_data, raise_missing=raise_missing) |
| 487 | |
| 488 | def put(self, id, data, wait=True): |
| 489 | """put a repo object |
| 490 | |
| 491 | Note: when doing calls with wait=False this gets async and caller must |
| 492 | deal with async results / exceptions later. |
| 493 | """ |
| 494 | self._lock_refresh() |
| 495 | data_size = len(data) |
| 496 | if data_size > MAX_DATA_SIZE: |
| 497 | raise IntegrityError(f"More than allowed put data [{data_size} > {MAX_DATA_SIZE}]") |
| 498 | |
| 499 | key = "data/" + bin_to_hex(id) |
| 500 | self.store.store(key, data) |
| 501 | |
| 502 | def delete(self, id, wait=True): |
| 503 | """delete a repo object |