I need a master reset button.

CommentFileSizeAuthor
#9 boost-578546.patch1.77 KBmikeytown2
#5 boost-578546.patch1.64 KBmikeytown2

Comments

dbeall’s picture

I'm not a fan of +1 posts, but there is always an exception.(i guess)
You took the words right out of my mind from an hour ago.

Here is my first +1

EDIT:
The reset button should also have remove 'cron last' and 'cron semaphore' entry from database.

mikeytown2’s picture

  db_query("DELETE FROM {variable} WHERE name LIKE '%s%%'", 'boost_crawl');
  db_query("DELETE FROM {variable} WHERE name = 'cron_semaphore'");
  cache_clear_all('variables', 'cache');

I think this code should do it.

dbeall’s picture

Thank you for the function. Some of this sql stuff is starting to look familiar, sometimes... I've been going through these lessons to get some basics pounded into my brain. It's a walk through of sql for dummies http://sqlcourse2.com/intro2.html

dbeall’s picture

I also had the thought when trouble shooting that clearing watchdog or DbLog, kind of a clean slate as not to get confused with an ongoing Log.
If i have this right,

<?php
  db_query("DELETE FROM {variable} WHERE name LIKE '%s%%'", 'boost_crawl');
  db_query("DELETE FROM {variable} WHERE name = 'cron_semaphore'");
  db_query('TRUNCATE TABLE {watchdog}');
  cache_clear_all('variables', 'cache');
?>

as always after a post, an after thought or footnote enters the mind..
I guess a clear DbLog button should be in the Drupal error reporting configuration page..? yes/no, All I want to do is dump the data, not uninstall it and re-install or have to goto PHPmyadmin and do it manually.
After all, we have clear cache button on Drupal performance configure page.

mikeytown2’s picture

Status: Active » Needs review
StatusFileSize
new1.64 KB
dbeall’s picture

Shared host, single domain, normal Drupal installed in sub folder. URL, debrafetty.us
Shared host, single domain, normal Drupal installed in Root. URL, arrowfence911.com
Shared and managed VPS(hotdrupal) normal Drupal installed in sub folder. URL, davebeall.com

All getting a status page error after using the clear button:

Status page:
Boost Crawler Key Not Found.
Please Run the database update, as the crawler key is not generated yet.

Run database update, same error.
Additional Notice from status page:
Re-run cron from status page(because says core update status not available, run cron manually).
AFTER re-run, update status OK

Drupal Notice: Cron ran successfully

Boost error remains:
Boost Crawler Key Not Found.
Please Run the database update, as the crawler key is not generated yet.

Comment: Should the notice and button say 'cron semaphore' or something recognizable to new users such as 'Quit Cron' or 'Re-set cron' ??

testing more sites in process..

mikeytown2’s picture

Status: Needs review » Needs work

Looks like I need to regenerate the crawler key! Thanks for testing; I'll say "Reset Cron".

dbeall’s picture

Status: Needs work » Needs review

The clear function needs to auto regenerate a crawler key? (my non-wizard guess)
You beat me to the post que..lol

mikeytown2’s picture

StatusFileSize
new1.77 KB
dbeall’s picture

another thought.. as usual
Is there a way to keep the 'core update status' as normal after using clear function?

dbeall’s picture

one site tested, seems to be ok now
continuing tests on more sites

EDIT:
second site tested, looks ok

mikeytown2’s picture

Status: Needs review » Reviewed & tested by the community
dbeall’s picture

3rd site looks good, 2 more to go.. will report back any errors if found.
The wizard has done it again!

EDIT: all my sites are working just fine with patch.. I have been jamming on it.. Stopping cron while in process with reset function and other abuses.. Still working fine.
I'm done testing this one...

mikeytown2’s picture

you sound like me... everyone knows 8 threads for a crawler is nuts, but when trying to create failure, it sure helps with the testing. I had to make sure the crawler was atomic; I would do 8 threads with a batch size of 1 or 2 depending on how I was feeling that day. From these tests I filed this bug #561990: Avoid variable_set() and variable_del() stampedes, and created my own variable_get & variable_set functions. Thanks for hammering this, it sounds like it works exactly how it should!

mikeytown2’s picture

Status: Reviewed & tested by the community » Fixed

committed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.