Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
Admin
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
osuny
Admin
Commits
7a94f3c3
Unverified
Commit
7a94f3c3
authored
1 year ago
by
Sébastien Gaya
Browse files
Options
Downloads
Patches
Plain Diff
clean and rebuild + comment
parent
22a43cc3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/models/communication/website/with_connected_objects.rb
+2
-2
2 additions, 2 deletions
app/models/communication/website/with_connected_objects.rb
cron.json
+1
-1
1 addition, 1 deletion
cron.json
lib/tasks/auto.rake
+5
-3
5 additions, 3 deletions
lib/tasks/auto.rake
with
8 additions
and
6 deletions
app/models/communication/website/with_connected_objects.rb
+
2
−
2
View file @
7a94f3c3
...
...
@@ -7,7 +7,7 @@ module Communication::Website::WithConnectedObjects
after_save :connect_about, if: :saved_change_to_about_id?
end
def
rebuild_connections_and_git_files
def
clean_and_rebuild
pages.find_each(&:connect_dependencies)
posts.find_each(&:connect_dependencies)
categories.find_each(&:connect_dependencies)
...
...
@@ -20,7 +20,7 @@ module Communication::Website::WithConnectedObjects
sync_with_git_without_delay
destroy_obsolete_git_files_without_delay
end
handle_asynchronously :
rebuild_connections_and_git_files
, queue: :low_priority
handle_asynchronously :
clean_and_rebuild
, queue: :low_priority
# Appelé
# - par un objet avec des connexions lorsqu'il est destroyed
...
...
This diff is collapsed.
Click to expand it.
cron.json
+
1
−
1
View file @
7a94f3c3
...
...
@@ -4,7 +4,7 @@
"command"
:
"0 1 * * * rails auto:update_publications_from_hal"
},
{
"command"
:
"0 3 * * * rails auto:
save_and_sync
_websites"
"command"
:
"0 3 * * * rails auto:
clean_and_rebuild
_websites"
}
]
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
lib/tasks/auto.rake
+
5
−
3
View file @
7a94f3c3
...
...
@@ -2,13 +2,15 @@ namespace :auto do
desc 'Update publications from HAL for all researchers'
task update_hal: :environment do
# Research::Hal.update_from_api! is synchronous, we use a job for that
Research::Hal::UpdateJob.perform_later
end
desc '
Resave
every website to enable publications in the future'
task
save_and_sync
_websites: :environment do
desc '
Clean and rebuild
every website to enable publications in the future'
task
clean_and_rebuild
_websites: :environment do
Communication::Website.find_each do |website|
website.rebuild_connections_and_git_files
# Communication::Website#clean_and_rebuild is asynchronous, no need for a intermediate job
website.clean_and_rebuild
end
end
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment