[Step 3] Update snippet statistics after project import
At the moment, the snippet info inside a project export, can be in three states depending on when the exported file was created:
- No repositories bundles and db data only
- Mix of repositories and db data only
- Only repository bundles
When the snippet doesn't have any repository data, after we import the snippet information, we manually migrate that snippet and perform commits operations to recreate the snippet repository with the existing db information. This means that, at some point, the git operation gets to the
PostReceive worker. In #223712 (closed) we implemented some logic to automatically refresh the snippet and project statistics after a git operation.
This means that, for snippet with no repository bundles, the statistics are updated automatically after recreating the snippet repository.
Nevertheless, when the exported file has snippet bundles, no git operation is performed. Therefore, we need to manually trigger the snippet statistics refresh after the bundle is imported.