Skip to content
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

Move log writing operation to a background job #8548

Merged
merged 1 commit into from
Oct 9, 2019

Conversation

vpereira
Copy link
Contributor

@vpereira vpereira commented Oct 9, 2019

Move log writing operation to a background job.

Non-critical operations, like log writing, shouldn't influence in the user experience.

@vpereira
Copy link
Contributor Author

vpereira commented Oct 9, 2019

@coolo
Copy link
Member

coolo commented Oct 9, 2019

So you create a DB entry to avoid creating a DB entry?

@vpereira
Copy link
Contributor Author

vpereira commented Oct 9, 2019

So you create a DB entry to avoid creating a DB entry?

perform_now is what I wanted, but it's too intrusive. But actually, what I really want is to remove the blocking logging operation of the main thread. The queue back-end used is just an "operation detail".. do you have any other suggestion? If it wasn't rails I would Fire it in a "fire and forget" Thread.new { } block

@vpereira vpereira force-pushed the move_create_log_entry_to_job branch 2 times, most recently from a8cdad9 to bdd9770 Compare October 9, 2019 10:53
@@ -79,7 +78,7 @@ def preview_copy
def copy
authorize @staging_workflow

StagingProjectCopyJob.perform_later(@staging_workflow.project.name, params[:staging_project_project_name], params[:staging_project_copy_name], User.session!.id)
StagingProjectCopyJob.perform_now(@staging_workflow.project.name, params[:staging_project_project_name], params[:staging_project_copy_name], User.session!.id)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes little sense, why do you change this?

Copy link
Contributor Author

@vpereira vpereira Oct 9, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes I was thinking about it too. Actually I wanted to go back to perform_later, but I've got sidetracked by another issue. perform_later is less intrusive. The logging has low priority and shouldn't block other jobs to execute..

@vpereira vpereira force-pushed the move_create_log_entry_to_job branch from bdd9770 to 5a6696d Compare October 9, 2019 11:03
@vpereira vpereira force-pushed the move_create_log_entry_to_job branch from 5a6696d to f42f014 Compare October 9, 2019 11:35
@hennevogel hennevogel merged commit 840cebb into openSUSE:master Oct 9, 2019
@vpereira vpereira deleted the move_create_log_entry_to_job branch October 10, 2019 06:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants