Batch up files when sending to a remote node
This commit is contained in:
@@ -1187,6 +1187,21 @@ class Address extends Model
|
||||
return NULL;
|
||||
}
|
||||
|
||||
public function getFiles(): Collection
|
||||
{
|
||||
if ($count=($num=$this->filesWaiting())->count()) {
|
||||
Log::info(sprintf('%s:= Got [%d] files for [%s] for sending',self::LOGKEY,$count,$this->ftn));
|
||||
|
||||
// Limit to max messages
|
||||
if ($count > $this->system->batch_files)
|
||||
Log::notice(sprintf('%s:= Only sending [%d] files for [%s]',self::LOGKEY,$this->system->batch_files,$this->ftn));
|
||||
|
||||
return $num->take($this->system->batch_files);
|
||||
}
|
||||
|
||||
return new Collection;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get netmail for this node (including it's children)
|
||||
*
|
||||
|
Reference in New Issue
Block a user