Content
View differences
Updated by Pavel Balashou about 2 years ago
:warning: This concerns the synchronization of AMPF enabled Projects and Storages.
### What does the synchronization job does:
A **lot** of stuff, namely:
1. Creates Project Folder if it isn't isn't there
2. Renames the folder if the need be
3. Removes access to the folder for all archived projects
4. Ensure that OpenProject admins, that have accessed the storage, have access to all folders
5. Remove permissions from users that lost access to that project
6. Add permissions to users that have been added to the project
All this is run for every `Storage` with `automatically_managed_folders_enabled` defined on the following occasions:
1. Every 60 5 mins (CronJob)
2. On Member
1. Create
2. Update
3. Destroyed (poor member)
3. On Project:
1. Updated
2. Renamed
3. Archived
4. Unarchived
4. On OAuthClientToken
1. Created
5. On Role:
1. Update
2. Destroyed
6. On storage:
1. Created
2. Updated
3. Destroyed
We have some debouncing going on to deal with this, but still it is a lot of triggers for a fairly expensive jobs.
### Proposal
We can first, break down the monolithic service into its parts, for example:
1. `CreateManagedFolderService`
2. 5. `RenameManagedFolderService`
3. 2. `HideManagedFolderService`
4. 3. `AddUserToManagedFolderService`
5. 4. `RemoveUserFromManagedFolderService`
The current implementation can then make use of those for its operations (maybe?)
Create new jobs for each of these and hook those to the events.
Once they are into place we can reduce the long expensive one to, let's let's say once every couple of hours or less.
A **lot** of stuff, namely:
1. Creates Project Folder if it isn't
2. Renames the folder if the need be
3. Removes access to the folder for all archived projects
4. Ensure that OpenProject admins, that have accessed the storage, have access to all folders
5. Remove permissions from users that lost access to that project
6. Add permissions to users that have been added to the project
1. Every 60
2. On Member
3. On Project:
4. On OAuthClientToken
5. On Role:
6. On storage:
### Proposal
We can first, break down the monolithic service into its parts, for example:
1. `CreateManagedFolderService`
2.
3.
4.
5.
The current implementation can then make use of those for its operations (maybe?)
Create new jobs for each of these and hook those to the events.
Once they are into place we can reduce the long expensive one to, let's