Batch up files when sending to a remote node

This commit is contained in:
2024-11-26 22:07:07 +11:00
parent 1296e3be40
commit 39034dbbb0
4 changed files with 30 additions and 6 deletions

View File

@@ -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)
*