mirror of
https://github.com/YunoHost-Apps/seafile_ynh.git
synced 2024-09-03 20:26:01 +02:00
17 lines
No EOL
449 B
Python
17 lines
No EOL
449 B
Python
from .objstore_factory import objstore_factory
|
|
|
|
class SeafBlockManager(object):
|
|
def __init__(self):
|
|
self.obj_store = objstore_factory.get_obj_store('blocks')
|
|
self._counter = 0
|
|
|
|
def read_count(self):
|
|
return self._counter
|
|
|
|
def load_block(self, repo_id, version, obj_id):
|
|
self._counter += 1
|
|
data = self.obj_store.read_obj(repo_id, version, obj_id)
|
|
return data
|
|
|
|
|
|
block_mgr = SeafBlockManager() |