luminal.tools.sentinel

Module Contents

Classes

Sentinel

Sentinel is a system watching mechanism created to dynamically monitor files or collect garbage.

class Sentinel(id=TextUtils().generate_id(10))

Bases: object

Sentinel is a system watching mechanism created to dynamically monitor files or collect garbage.

Parameters:

id (str) –

_find_garbage(path)

Obtains all blacklisted files and directories recursively within a given path.

Parameters:

path (str) – The directory that the sentinel should monitor for collection.

Return type:

int

_check_system()

Gathers all Python based cache files and removes them recursively.

Return type:

None

_start_resolving(time=1)

Creates a monitor resolver by utilizing a non-blocking asynchronous system watcher function.

Parameters:

time (Optional[int]) – How long the thread should wait before continuing to loop.

Return type:

None

start()

Starts the sentinel and allows it to monitor as long as monitoring and authorized is set to True.

Return type:

None

async watch_system(time)

|coro|

Initial sentinel loop which allows the sentinel to monitor for artifacts.

Parameters:

time (int) – How long the thread should wait before continuing to loop.

Return type:

None