Implemented Dynamic Items for data to be sent to polled systems based on data in db, like stats/nodelists
This commit is contained in:
@@ -6,6 +6,7 @@ use Exception;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use League\Flysystem\UnreadableFileEncountered;
|
||||
|
||||
use App\Classes\File\Send\Dynamic;
|
||||
use App\Classes\Node;
|
||||
use App\Models\Address;
|
||||
|
||||
@@ -129,6 +130,31 @@ class Send extends Base
|
||||
$this->index = NULL;
|
||||
}
|
||||
|
||||
public function dynamic(Address $ao): bool
|
||||
{
|
||||
$file = FALSE;
|
||||
|
||||
// If the node is marked as hold - dont send any files.
|
||||
if ($ao->system->hold) {
|
||||
Log::info(sprintf('%s: - System [%d] is marked as hold - not checking for files.',self::LOGKEY,$ao->system_id));
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// Files
|
||||
if (($x=$ao->dynamicWaiting())->count()) {
|
||||
Log::debug(sprintf('%s:- [%d] Dynamic Files(s) added for sending to [%s]',self::LOGKEY,$x->count(),$ao->ftn));
|
||||
|
||||
// Add Files
|
||||
foreach ($x as $do)
|
||||
$this->list->push(new Dynamic($do,$ao,self::T_FILE));
|
||||
|
||||
$file = TRUE;
|
||||
}
|
||||
|
||||
return $file;
|
||||
}
|
||||
|
||||
/*
|
||||
private function compress(string $comp_mode): void
|
||||
{
|
||||
|
Reference in New Issue
Block a user