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

Feat: Queue uniqueness #151

Merged
merged 6 commits into from
Jun 2, 2023
Merged

Feat: Queue uniqueness #151

merged 6 commits into from
Jun 2, 2023

Conversation

steveworley
Copy link
Contributor

  • Adds new QuantQueue class which manages a hash for each item
  • Adds an update hook to create the new queue table
  • Fixes an issue with default values for quant_seed_entity_node_bundles

@steveworley steveworley requested review from stooit and kepol May 26, 2023 04:34
@kepol kepol self-assigned this May 26, 2023
Copy link
Contributor

@kepol kepol left a comment

Choose a reason for hiding this comment

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

I haven't tested yet but did a first pass review.

quant.install Show resolved Hide resolved
quant.install Outdated Show resolved Hide resolved
quant.install Show resolved Hide resolved
quant.install Outdated Show resolved Hide resolved
quant_queue_class.inc Outdated Show resolved Hide resolved
quant_queue_class.inc Show resolved Hide resolved
quant_queue_class.inc Show resolved Hide resolved
quant_queue_class.inc Outdated Show resolved Hide resolved
quant_queue_class.inc Outdated Show resolved Hide resolved
quant_queue_class.inc Outdated Show resolved Hide resolved
quant.install Outdated Show resolved Hide resolved
quant_queue_class.inc Outdated Show resolved Hide resolved
Co-authored-by: Kristen Pol <github@kristen.org>
@kepol
Copy link
Contributor

kepol commented May 29, 2023

I haven’t tested but the changes look good. I might be able to test tomorrow.

@kepol
Copy link
Contributor

kepol commented May 30, 2023

I did a quick test and am getting this error on the seed form when running but I'll see if I can figure it out.

An AJAX HTTP error occurred. HTTP Result Code: 500 Debugging information follows. Path: /batch?id=135&op=do_nojs&op=do StatusText: ResponseText: Error: Object of class DatabaseStatementBase could not be converted to string in check_plain() (line 1908 of /var/www/html/includes/bootstrap.inc).Uncaught exception thrown in shutdown function.Exception: Serialization of &#039;DatabaseStatementBase&#039; is not allowed in serialize() (line 493 of /var/www/html/includes/batch.inc).

@kepol
Copy link
Contributor

kepol commented May 30, 2023

I think it's working with the fix above... I have a site with one node. The database seems to match the queue tab.

Database:

MariaDB [db]> select * from quant_queue;
+---------+------------+---------------------------------------------------------------------+--------+------------+--------------------------------------------------+
| item_id | name       | data                                                                | expire | created    | hash                                             |
+---------+------------+---------------------------------------------------------------------+--------+------------+--------------------------------------------------+
|       5 | quant_seed | a:2:{i:0;s:10:"quant_seed";i:1;a:1:{i:0;s:17:"http://localhost/";}} |      0 | 1685416535 | sha256AGMQGToVeuiPrk9in3b+GXcoBHLlHWvGKVXtSEJmcx |
|       6 | quant_seed | a:2:{i:0;s:21:"quant_seed_node_batch";i:1;a:1:{i:0;s:1:"1";}}       |      0 | 1685416535 | sha256CekNh264Gij5YPBpk6B4eZPxEGCTNfuX9YhUyKTHvP |
+---------+------------+---------------------------------------------------------------------+--------+------------+--------------------------------------------------+
2 rows in set (0.005 sec)
Screen Shot 2023-05-29 at 8 18 55 PM

Copy link
Contributor

@kepol kepol left a comment

Choose a reason for hiding this comment

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

Tested it a bit more and it seems like it's okay. Thanks.

@steveworley
Copy link
Contributor Author

Perfect thanks @kepol! Will get this merged in now. I made a small change as well to set the queue class on install after a bit more testing today.

MariaDB [drupal]> select item_id, hash from quant_queue limit 1;
+---------+--------------------------------------------------+
| item_id | hash                                             |
+---------+--------------------------------------------------+
|     189 | sha256+efo63qevgWdP/JNzSe+Pd2O0esxIhoW5XSCXxvS8n |
+---------+--------------------------------------------------+
1 row in set (0.001 sec)

quant.install Outdated Show resolved Hide resolved
@steveworley steveworley requested a review from kepol June 2, 2023 02:13
Copy link
Contributor

@kepol kepol left a comment

Choose a reason for hiding this comment

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

Looks good!

@steveworley steveworley merged commit b26ba6e into 7.x-1.x Jun 2, 2023
@steveworley steveworley deleted the feat/7-x-queue-uniqueness branch June 2, 2023 02:14
@kepol kepol removed their assignment Jun 13, 2023
@kepol
Copy link
Contributor

kepol commented Jun 13, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Drupal 7 enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants