Page MenuHomePhorge

Avoid large queries in greylist request
ClosedPublic

Authored by mollekopf on Aug 27 2021, 10:00 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Nov 23, 6:57 PM
Unknown Object (File)
Nov 3 2023, 11:09 AM
Unknown Object (File)
Oct 18 2023, 10:45 AM
Unknown Object (File)
Oct 18 2023, 12:24 AM
Unknown Object (File)
Oct 13 2023, 11:24 PM
Unknown Object (File)
Oct 5 2023, 1:40 AM
Unknown Object (File)
Sep 28 2023, 3:16 PM
Unknown Object (File)
Sep 26 2023, 1:10 PM
Subscribers
None

Details

Reviewers
vanmeeuwen
Group Reviewers
Restricted Project
Commits
rK8beb43d39950: Avoid large queries in greylist request
Summary

The assumption is that the following query can yield a lot of results
for e.g. gmail.com:

$entries = Connect::where(
    [
        'sender_domain' => $this->senderDomain,
        'net_id' => $this->netID,
        'net_type' => $this->netType
    ]
)
    ->whereDate('updated_at', '>=', $this->timestamp->copy()->subDays(7));

Instead of counting and updating all of them, we only to the minimum
work necessary:

  • Update all entries that are currently greylisted
  • Count if we have at least 5 entries to automatically create a whitelist

This changes that entries that already have greylisting = false will
not get updated_at updated.

Diff Detail

Repository
rK kolab
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

mollekopf created this revision.
mollekopf added a reviewer: Restricted Project.Aug 27 2021, 10:00 AM
This revision is now accepted and ready to land.Aug 27 2021, 10:47 AM
This revision was automatically updated to reflect the committed changes.