File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -67,9 +67,18 @@ protected function loadData(): Batchable
6767 $ this ->tempFilePath = Assets::tempFilePath ('jsonl ' );
6868 }
6969
70+ $ fileExists = file_exists ($ this ->tempFilePath );
71+ $ fileSize = $ fileExists ? filesize ($ this ->tempFilePath ) : 0 ;
72+
73+ // If somehow a zero-byte file exists, remove it to force a re-download
74+ if ($ fileExists && $ fileSize === 0 ) {
75+ FileHelper::unlink ($ this ->tempFilePath );
76+ $ fileExists = false ;
77+ }
78+
7079 // Only re-download if the file doesn't already exist
7180 // If the queue is using multiple workers and the file leaks between them,
72- if (!file_exists ( $ this -> tempFilePath ) ) {
81+ if (!$ fileExists ) {
7382 // Retrieve remote file contents
7483 $ client = Craft::createGuzzleClient ();
7584 $ response = $ client ->get ($ this ->dataUrl );
You can’t perform that action at this time.
0 commit comments