FIX Ensure queued job signature remains under 64 character limit (fixes Postgres error)

This commit is contained in:
Robbie Averill 2017-11-30 14:53:45 +13:00
parent e47ab9c07d
commit fccac37621
4 changed files with 8 additions and 15 deletions

View File

@ -109,9 +109,7 @@ class SearchUpdateCommitJobProcessor implements QueuedJob
public function getSignature()
{
// There is only ever one commit job on the queue so the signature is consistent
// See QueuedJobService::queueJob() for the code that prevents duplication
return __CLASS__;
return sha1(get_class($this) . time() . mt_rand(0, 100000));
}
public function getTitle()

View File

@ -90,11 +90,6 @@ class SolrReindexGroupQueuedJob extends SolrReindexQueuedJobBase
$this->group = $jobData->group;
}
public function getSignature()
{
return md5(get_class($this) . time() . mt_rand(0, 100000));
}
public function getTitle()
{
return sprintf(

View File

@ -65,11 +65,6 @@ class SolrReindexQueuedJob extends SolrReindexQueuedJobBase
$this->classes = $jobData->classes;
}
public function getSignature()
{
return __CLASS__;
}
public function getTitle()
{
return 'Solr Reindex Job';

View File

@ -138,6 +138,11 @@ abstract class SolrReindexQueuedJobBase implements QueuedJob
return QueuedJob::QUEUED;
}
public function getSignature()
{
return sha1(get_class($this) . time() . mt_rand(0, 100000));
}
public function addMessage($message)
{
$this->messages[] = $message;