Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Scheduler] Separate id and description in message providers#52874

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

valtzu
Copy link
Contributor

@valtzuvaltzu commentedDec 3, 2023
edited
Loading

QA
Branch?6.4
Bug fix?yes
New feature?no
Deprecations?no
IssuesFix#52853
LicenseMIT

Separate id and description in message providers to keepdebug:schedule output clean while allowing arbitrary distinct id.

@carsonbot
Copy link

Hey!

Thanks for your PR. You are targeting branch "7.1" but it seems your PR description refers to branch "6.4".
Could you update the PR description or change target branch? This helps core maintainers a lot.

Cheers!

Carsonbot

valtzu reacted with thumbs up emoji

@valtzu
Copy link
ContributorAuthor

Not sure what to do with the tests sinceFrameworkBundle tests now depend on the unreleased/unmerged Scheduler version (this PR).

@valtzuvaltzuforce-pushed the52853-scheduler-arguments-fix branch fromd5f9d45 to52423eaCompareDecember 6, 2023 10:43
@alex-dev
Copy link
Contributor

While you're addressing this, could you check other__toString scheduled messages?RedispatchMessage is also affected.

@valtzu
Copy link
ContributorAuthor

valtzu commentedDec 6, 2023
edited
Loading

While you're addressing this, could you check other__toString scheduled messages?RedispatchMessage is also affected.

@alex-dev butRedispatchMessage uses the wrapped message's__toString() and it does include the transport names in __toString so I don't think it's affected itself directly?


Or yeah if you don't implement__toString in your message, then it is affected indeed. But since right now__toString is how you define uniqueness, I would consider that a feature and not a bug.

@alex-dev
Copy link
Contributor

You don't define uniqueness only by__toString. If a message doesn't implement a__toString,Schedule useserialize. So, if a message wrapped by aRedispatchMessage is notStringable, they should be serialized to determine uniqueness.RedispatchMessage should be transparent for identifying uniqueness.

@valtzuvaltzuforce-pushed the52853-scheduler-arguments-fix branch 2 times, most recently from687a3d6 tobd6144eCompareDecember 6, 2023 19:30
@valtzu
Copy link
ContributorAuthor

valtzu commentedDec 6, 2023
edited
Loading

Ok then, I separated id & description and used hashed serialized message for uniqueness withStaticMessageProvider.

I would've rather added explicitgetDescription() onMessageProviderInterface but with optional__toString we should be able to avoid dealing with BC.

What do you think?

We could also consider addingid parameter to#[AsPeriodicTask] &#[AsCronTask] attributes in case someone would rather have static ids which don't depend on message content.

@valtzuvaltzu changed the title[Scheduler] DistinguishServiceCallMessage arguments in scheduler[Scheduler] Separate id and description in message providersDec 6, 2023
@alex-dev
Copy link
Contributor

Seems good!

@valtzuvaltzu requested a review fromfabpotDecember 16, 2023 14:12
Copy link
Member

@nicolas-grekasnicolas-grekas left a comment

Choose a reason for hiding this comment

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

LGTM with a minor comment

@nicolas-grekasnicolas-grekasforce-pushed the52853-scheduler-arguments-fix branch frome57d177 tod73bf83CompareJanuary 2, 2024 13:07
@nicolas-grekas
Copy link
Member

Thank you@valtzu.

@nicolas-grekasnicolas-grekas merged commita84d42b intosymfony:6.4Jan 2, 2024

return new self($trigger, new StaticMessageProvider([$message], $description));
return new self($trigger, new StaticMessageProvider([$message],strtr(substr(base64_encode(hash('xxh128', serialize($message), true)), 0, 7), '/+', '._'), -7),$description));
Copy link
Member

Choose a reason for hiding this comment

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

FYI, there was a syntax error on this line. I fixed that ina45f6cb. Please double-check that I didn't mess anything with the logic implemented here.

valtzu reacted with thumbs up emoji
This was referencedJan 31, 2024
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@xabbuhxabbuhxabbuh left review comments

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

@kbondkbondAwaiting requested review from kbondkbond is a code owner

@fabpotfabpotAwaiting requested review from fabpot

Assignees
No one assigned
Projects
None yet
Milestone
6.4
Development

Successfully merging this pull request may close these issues.

[Scheduler] Cannot have multiple #[AsPeriodicTask] on the same method with the same frequency
6 participants
@valtzu@carsonbot@alex-dev@nicolas-grekas@fabpot@xabbuh

[8]ページ先頭

©2009-2025 Movatter.jp