Skip to content
Snippets Groups Projects
Unverified Commit 465d8142 authored by Sébastien Gaya's avatar Sébastien Gaya Committed by GitHub
Browse files

add analyse repository to nightly clean&rebuild (#2544)

parent 9ffa4775
No related branches found
No related tags found
No related merge requests found
class Admin::Communication::Websites::GitAnalysisController < Admin::Communication::Websites::ApplicationController
# Ce n'est pas une ressource nested comme dependencies,
# Ce n'est pas une ressource nested comme dependencies,
# donc on doit charger explicitement pour utiliser id et pas website_id
load_and_authorize_resource :website,
id_param: :id,
......@@ -15,8 +15,8 @@ class Admin::Communication::Websites::GitAnalysisController < Admin::Communicati
end
def launch
Git::OrphanAndLayoutAnalyzer.new(@website).launch
redirect_back fallback_location: admin_communication_website_path(@website),
@website.analyse_repository!
redirect_back fallback_location: admin_communication_website_path(@website),
notice: t('admin.communication.website.git_file.analysis.launched')
end
end
\ No newline at end of file
......@@ -39,7 +39,7 @@ class Server::WebsitesController < Server::ApplicationController
end
def analyse
Git::OrphanAndLayoutAnalyzer.new(@website).launch
@website.analyse_repository!
redirect_back fallback_location: server_website_path(@website),
notice: t('admin.communication.website.git_file.analysis.launched')
end
......
......@@ -26,6 +26,7 @@ module Communication::Website::WithConnectedObjects
sync_with_git_safely
destroy_obsolete_git_files_safely
get_current_theme_version!
analyse_repository!
screenshot!
end
......
......@@ -90,4 +90,9 @@ module Communication::Website::WithGitRepository
git_repository.update_theme_version!
end
def analyse_repository!
return unless should_sync_with_git?
Git::OrphanAndLayoutAnalyzer.new(self).launch
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment