Retry posting
This commit is contained in:
@ -167,6 +167,9 @@ class InstagramRepostJob extends BrowserJob implements ShouldBeUniqueUntilProces
|
||||
]));
|
||||
|
||||
// Download the reels
|
||||
/**
|
||||
* @var mixed[]
|
||||
*/
|
||||
$downloadedReels = [];
|
||||
foreach ($toDownloadReels as $repost) {
|
||||
$downloadedReels[] = [
|
||||
@ -189,8 +192,11 @@ class InstagramRepostJob extends BrowserJob implements ShouldBeUniqueUntilProces
|
||||
$reel = $infos[0];
|
||||
$videoInfo = $infos[1];
|
||||
|
||||
// TODO : Avoid getting the reel from the db again, store it in the downloadedReels array
|
||||
$repostedReelsCounter += $this->repostReel($browser, InstagramRepost::where('reel_id', $reel->reel_id)->first(), $videoInfo);
|
||||
$repostSuccess = false;
|
||||
do {
|
||||
$repostSuccess = $this->repostReel($browser, $reel, $videoInfo);
|
||||
} while (!$repostSuccess && $reel->repost_tries < self::MAX_REPOST_TRIES);
|
||||
$repostedReelsCounter += $repostSuccess;
|
||||
}
|
||||
|
||||
$this->jobRun->addArtifact(new JobArtifact([
|
||||
|
Reference in New Issue
Block a user