-
Notifications
You must be signed in to change notification settings - Fork 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
Scheduler does not index any pages #95
Comments
What version of Grav is this? |
Sorry, should have included that.
|
Same issue on Grav 1.7 |
Ok, I dug into this a bit today. During the past few months, we broke out much of the initialization code so that it could be controlled at a more granular level. This was so that we didn't have to load so much stuff when it was not needed, therefore increasing performance overall. The CLI code has a bunch of built-in initialization methods that can be called independently. For example, Because of this the scheduler is not fully initialized for pages, and these init methods are in I think eventually I would like to move these to somewhere more 'accessible' by other things other than just console commands, so we can more easily |
Signed-off-by: Andy Miller <rhuk@mac.com>
With Andy's fix and both fixes mentioned in #81 it should be running fine now. Tested on Grav 1.6.27 and TNTSearch Plugin version 3.2.1. |
When I run
Grav\Plugin\TNTSearchPlugin::indexJob
using the Grav scheduler no pages are being indexed. This means the TNTSearch database gets emptied of all contents, and all searches return no results.The output below shows the issue. Initially there are 137 rows in the wordlist table, but after running
indexJob
via the Grav scheduler there are 0 rows. If I then runbin/plugin tntsearch index
there are 137 rows again.I took a look at the code and it seems this is because
$grav['pages']->init()
is never called when running the scheduler job, so there is no data to index. When usingbin/plugin tntsearch index
the pages get initialised through the$this->initializePages()
call inIndexerCommand::serve()
.I'm not sure if the Grav core should be initialising pages when the scheduler is run, or whether it should be done in the plugin. And I don't know enough about how Grav works to know what call needs to be made to initialise the pages. It looks like events need to be fired etc, so it's not just a matter of calling
$grav['pages']->init()
.My temporary solution is to run
bin/plugin tntsearch index
via it's own cronjob and disable theindexJob
scheduled job.I originally added a comment to issue #81 about this, but I think that is actually a separate issue, as the scheduler job is running fine it's just not indexing anything.
The text was updated successfully, but these errors were encountered: