Remove/reduce usage of QueryCache

This commit is contained in:
2024-11-27 18:41:27 +11:00
parent 119f2cb6b9
commit fc11700601
6 changed files with 17 additions and 19 deletions

View File

@@ -50,7 +50,6 @@ class MailSend #implements ShouldQueue
->join('domains',['domains.id'=>'zones.domain_id'])
->groupBy('a.system_id','a.id','a.zone_id','addresses.region_id','a.host_id','a.node_id','a.point_id','addresses.hub_id','addresses.role')
->with(['system','zone.domain'])
->dontCache()
->get();
// Return the system we poll

View File

@@ -233,13 +233,6 @@ class MessageProcess implements ShouldQueue
// Check for duplicate messages
// FTS-0009.001
if ($this->mo->msgid) {
$o = ($x=Echomail::where('msgid',$this->mo->msgid)
->where('fftn_id',$this->mo->fftn_id)
->where('datetime','>=',$this->mo->datetime->clone()->subYears(3))
->where('datetime','<=',$this->mo->datetime)
->dontCache())
->single();
Log::debug(sprintf('%s:- Checking for duplicate from host id [%d], with msgid [%s] between [%s] and [%s].',
self::LOGKEY,
$this->mo->fftn_id,
@@ -248,6 +241,11 @@ class MessageProcess implements ShouldQueue
$this->mo->datetime,
));
$x = Echomail::where('msgid',$this->mo->msgid)
->where('fftn_id',$this->mo->fftn_id)
->where('datetime','>=',$this->mo->datetime->clone()->subYears(3))
->where('datetime','<=',$this->mo->datetime);
if ($x->count()) {
// @todo Actually update seenby
Log::alert(sprintf('%s:! Duplicate echomail (%s) in [%s] from (%s) [%s] to (%s) - ignoring.',
@@ -270,7 +268,6 @@ class MessageProcess implements ShouldQueue
$o = Echomail::where('msg_crc',$xx=md5($this->mo->msg_crc))
->where('fftn_id',$this->mo->fftn_id)
->where('datetime','>',Carbon::now()->subWeek())
->dontCache()
->get();
if ($o->count())