-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GO-2827 Unbind user files (reclaim / reconcile space usage) #1226
Changes from 13 commits
8f4c003
0f90551
47d7751
0f770e3
b46d1e1
b012590
c5c01c6
3346906
8a6842b
b1d7b24
4eafba9
368b80a
07f1cda
431a455
9ef26cf
a9d457a
a790d69
bcad681
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,7 @@ import ( | |
"github.com/anyproto/anytype-heart/core/domain" | ||
"github.com/anyproto/anytype-heart/core/domain/objectorigin" | ||
"github.com/anyproto/anytype-heart/core/files" | ||
"github.com/anyproto/anytype-heart/core/filestorage" | ||
"github.com/anyproto/anytype-heart/core/filestorage/filesync" | ||
"github.com/anyproto/anytype-heart/core/syncstatus/filesyncstatus" | ||
"github.com/anyproto/anytype-heart/pb" | ||
|
@@ -77,6 +78,7 @@ type service struct { | |
fileService files.Service | ||
fileSync filesync.FileSync | ||
fileStore filestore.FileStore | ||
fileStorage filestorage.FileStorage | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ensure proper error handling for The initialization of - s.fileStorage = app.MustComponent[filestorage.FileStorage](a)
+ s.fileStorage, err = app.MustComponent[filestorage.FileStorage](a)
+ if err != nil {
+ return fmt.Errorf("failed to initialize fileStorage: %w", err)
+ }
|
||
objectStore objectstore.ObjectStore | ||
spaceIdResolver idresolver.Resolver | ||
migrationQueue *persistentqueue.Queue[*migrationItem] | ||
|
@@ -109,6 +111,7 @@ func (s *service) Init(a *app.App) error { | |
s.objectStore = app.MustComponent[objectstore.ObjectStore](a) | ||
s.fileStore = app.MustComponent[filestore.FileStore](a) | ||
s.spaceIdResolver = app.MustComponent[idresolver.Resolver](a) | ||
s.fileStorage = app.MustComponent[filestorage.FileStorage](a) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In the |
||
|
||
s.indexer = s.newIndexer() | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider refactoring the
Apply
method to improve readability and maintainability.The
Apply
method is quite lengthy and handles multiple responsibilities. It would be beneficial to break this method into smaller, more focused methods. This can improve readability, make the code easier to maintain, and simplify unit testing.