$14 GRAYBYTE WORDPRESS FILE MANAGER $42

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 104.21.43.35 | ADMIN IP 216.73.216.180
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : mail

/opt/imunify360/venv/lib/python3.11/site-packages/defence360agent/model/

HOME
Current File : /opt/imunify360/venv/lib/python3.11/site-packages/defence360agent/model//icontact.py
import time

from peewee import CharField, IntegerField, CompositeKey

from defence360agent.contracts.config import IContactMessageType
from defence360agent.model import Model, instance
from defence360agent.utils.common import DAY, WEEK

THROTTLING_PERIOD = {
    IContactMessageType.MALWARE_FOUND: DAY,
    IContactMessageType.SCAN_NOT_SCHEDULED: WEEK,
}


class IContactThrottle(Model):
    class Meta:
        database = instance.db
        db_table = "icontact_throttle"
        primary_key = CompositeKey("message_type", "user")

    message_type = CharField()
    user = CharField(null=True)
    #: The last time we sent a notification about :attr:`message_type`
    timestamp = IntegerField(default=0)

    @classmethod
    def may_be_notified(cls, message_type, period_limit, user=None):
        obj, _ = cls.get_or_create(message_type=message_type, user=user)
        return (time.time() - obj.timestamp) > period_limit

    @classmethod
    def refresh(cls, message_type, user=None):
        cls.update(timestamp=time.time()).where(
            cls.message_type == message_type,
            cls.user.is_null(True) if user is None else cls.user == user,
        ).execute()


Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
3 Mar 2026 8.45 AM
root / root
0755
__pycache__
--
3 Mar 2026 8.45 AM
root / root
0755
__init__.py
0.94 KB
23 Jan 2026 1.13 PM
root / root
0644
analyst_cleanup.py
3.401 KB
23 Jan 2026 1.13 PM
root / root
0644
event_hook.py
1.741 KB
23 Jan 2026 1.13 PM
root / root
0644
icontact.py
1.155 KB
23 Jan 2026 1.13 PM
root / root
0644
infected_domain.py
4.236 KB
23 Jan 2026 1.13 PM
root / root
0644
instance.py
0.523 KB
23 Jan 2026 1.13 PM
root / root
0644
messages_to_send.py
1.371 KB
23 Jan 2026 1.13 PM
root / root
0644
simplification.py
5.013 KB
23 Jan 2026 1.13 PM
root / root
0644
tls_check.py
1.289 KB
23 Jan 2026 1.13 PM
root / root
0644
wordpress_incident.py
13.016 KB
23 Jan 2026 1.13 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF