SilverStripe\StaticPublishQueue\Job
Class Job
Synopsis
class Job
extends AbstractQueuedJob
{
- // members
- private static integer $chunk_size = 200;
- // methods
- public int|null getRunAsMemberID()
- public void setup()
- public void getSignature()
- public void process()
- protected abstract void processUrl()
- protected void markUrlAsProcessed()
- protected void updateCompletedState()
- protected int getChunkSize()
- protected void handleFailedUrl()
Hierarchy
Extends
- Symbiote\QueuedJobs\Services\AbstractQueuedJob
Uses
- SilverStripe\Core\Config\Configurable
- SilverStripe\Core\Extensible
Members
private
- $chunk_size
—
int
Number of URLs processed during one call of @see AbstractQueuedJob::process() this number should be set to a value which represents number of URLs which is reasonable to process in one go this number will vary depending on project, more specifically it depends on: - time to render your pages - infrastructure
Methods
protected
- getChunkSize()
- handleFailedUrl() — This function can be overridden to handle the case of failure of specific URL processing such case is not handled by default which results in all such errors being effectively silenced
- markUrlAsProcessed() — Move URL to list of processed URLs and update job step to indicate progress indication of progress is important for jobs which take long time to process jobs that do not indicate progress may be identified as stalled by the queue and may end up paused
- processUrl() — Implement this method to process URL
- updateCompletedState() — Check if job is complete and update the job state if needed
public
- getRunAsMemberID() — Static cache manipulation jobs need to run without a user this is because we don't want any session related data to become part of URLs For example stage GET param is injected into URLs when user is logged in This is problematic as stage param must not be present in statically published URLs as they always refer to live content Including stage param in visiting URL is meant to bypass static cache and redirect to admin login this is something we definitely don't want for statically cached pages
- getSignature()
- process()
- setup()