mirror of
https://github.com/etesync/server
synced 2024-11-22 08:48:07 +00:00
Chunks: use a prefix of the chunk for a subdirectory.
Filesystems don't handle massive directories too well, so better to split. Using the prefix of the chunk gives us a maximum of 64 * 64 = 4096 entries in the main directory.
This commit is contained in:
parent
393b85d3ca
commit
e385aa8f20
@ -87,7 +87,9 @@ def chunk_directory_path(instance, filename):
|
||||
|
||||
col = instance.collection
|
||||
user_id = col.owner.id
|
||||
return Path('user_{}'.format(user_id), col.uid, instance.uid)
|
||||
uid_prefix = instance.uid[:2]
|
||||
uid_rest = instance.uid[2:]
|
||||
return Path('user_{}'.format(user_id), col.uid, uid_prefix, uid_rest)
|
||||
|
||||
|
||||
class CollectionItemChunk(models.Model):
|
||||
|
Loading…
Reference in New Issue
Block a user