Skip to content

Fix - Parameterize config to accept connection names. #23

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

Merged
merged 5 commits into from
Jun 4, 2021

Conversation

atrauzzi
Copy link
Contributor

@atrauzzi atrauzzi commented Jun 4, 2021

Closes: #22

@marickvantuil - The one thing I could use your input on is how to update the calls to Config in TaskHandler. I've made a first attempt at it and tested it locally with a payload and it checks out!

atrauzzi added 2 commits June 4, 2021 10:21
 - `TaskHandler` still needs to be updated. Might look for some input there.
 - This attempts to obtain the connection name as early as possible so that it can be passed as needed.
 - We'll continue to default to `"cloudtasks"`
Comment on lines 31 to 32
$command = unserialize($task['data']['command']);
$connection = $command->connection ?? 'cloudtasks';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had to flip the order here a little. The payload is being unserialized and read for the connection value as it cannot be authorized without knowing which connection to use! 😄

@marickvantuil
Copy link
Member

Thanks for this fix! I've fixed one test that was failing.

Locally something was still breaking for me. When I push to the default queue that has a different connection name than cloudtasks, and then later get the connection name from the payload, it seemed to be null (think thats default Laravel behavior?):

Screenshot 2021-06-04 at 21 47 44

Fixed that by using the default connection name in that case, instead of cloudtasks.

Also did a pass to clean up the config, what do you think?

@atrauzzi
Copy link
Contributor Author

atrauzzi commented Jun 4, 2021

It might depend on the connection being explicitly specified on the job itself, which is a property that laravel defines that jobs can set/override.

But yeah, looks good! I can try this out right away once it's merged and the package is updated. 😁

@marickvantuil marickvantuil merged commit aa0f805 into stackkit:master Jun 4, 2021
@atrauzzi atrauzzi deleted the fix/connection-names branch June 5, 2021 00:48
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.

Underlying google libs throwing an exception
2 participants