Skip to content

Make getIssueFullPattern() concurrency save - bugfix #16415 (#16155, #16185) #16416

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

Closed
wants to merge 1 commit into from
Closed

Make getIssueFullPattern() concurrency save - bugfix #16415 (#16155, #16185) #16416

wants to merge 1 commit into from

Conversation

Dexus
Copy link
Contributor

@Dexus Dexus commented Jul 13, 2021

Run processors on whole of text (#16155) #16185

This PR makes the function concurrent save. Fix the mention in PR #16185 and merge 5ff807a

Fixes #16415

@6543
Copy link
Member

6543 commented Jul 13, 2021

@Dexus can you please target master first and then we will backport stuff if merged?

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jul 13, 2021
@6543 6543 added this to the 1.15.0 milestone Jul 13, 2021
@@ -70,9 +70,6 @@ var (
// CSS class for action keywords (e.g. "closes: #1")
const keywordClass = "issue-keyword"

// regexp for full links to issues/pulls
var issueFullPattern *regexp.Regexp
Copy link
Member

Choose a reason for hiding this comment

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

I would propose a sync.Once loock

Copy link
Member

Choose a reason for hiding this comment

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

oh no you dont need to

Copy link
Contributor

@mohe2015 mohe2015 Jul 13, 2021

Choose a reason for hiding this comment

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

Probably an antipattern but the init() function would also work, wouldn't it?

Copy link
Member

Choose a reason for hiding this comment

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

yes is init is an antipattern ...

var issueFullPattern = regexp.MustCompile(regexp.QuoteMeta(setting.AppURL) +
`\w+/\w+/(?:issues|pulls)/((?:\w{1,10}-)?[1-9][0-9]*)([\?|#]\S+.(\S+)?)?\b`)

return func() *regexp.Regexp {
Copy link
Contributor

Choose a reason for hiding this comment

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

Offtopic and I don't know go but would this really be needed (creating and calling this function)

Copy link
Member

Choose a reason for hiding this comment

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

no did just create a pull

@6543
Copy link
Member

6543 commented Jul 13, 2021

see #16417

@6543 6543 closed this Jul 13, 2021
@6543 6543 removed this from the 1.15.0 milestone Jul 13, 2021
@Dexus Dexus deleted the concurrency-save-getIssueFullPattern-v1.14 branch July 13, 2021 14:40
@Dexus
Copy link
Contributor Author

Dexus commented Jul 13, 2021

I'm glad it's fixed, even if it's a pity that you're deprived of your own contribution.

@6543
Copy link
Member

6543 commented Jul 13, 2021

@Dexus I thought about creating the diff and send it to you ... but it was easyer to just submit a pull then ...

I of cousre can mention you in the pull if you like

beside you did targed the wrong branch :D

@Dexus
Copy link
Contributor Author

Dexus commented Jul 13, 2021

That's not my point at all. Find it only a pity and wanted to put it also so to the expression.
So you can also show strangers that they should stay "outside".
Everything else would not have been the problem.

Anyway, thanks that it was addressed.

@6543
Copy link
Member

6543 commented Jul 13, 2021

@Dexus as per #16417 (comment) I think you can have the cance to a pull now ;)

just use sync.Once to init it on first call to the func

@go-gitea go-gitea locked and limited conversation to collaborators Oct 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants