File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -154,6 +154,12 @@ You can execute the SQL Loader command using the `execute` method.
154154$loader->execute();
155155```
156156
157+ You can also set the execution timeout in seconds. Default is 3600 seconds / 1 hr.
158+
159+ ``` php
160+ $loader->execute(60);
161+ ```
162+
157163### Execution Result
158164
159165You can check if the execution was successful using the ` successfull ` method.
Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ public function into(
9999 /**
100100 * Execute SQL Loader command.
101101 */
102- public function execute (): ProcessResult
102+ public function execute (int $ timeout = 3600 ): ProcessResult
103103 {
104104 if (! $ this ->tables ) {
105105 throw new InvalidArgumentException ('At least one table definition is required. ' );
@@ -109,7 +109,7 @@ public function execute(): ProcessResult
109109 throw new InvalidArgumentException ('Input file is required. ' );
110110 }
111111
112- $ this ->result = Process::run ($ this ->buildCommand ());
112+ $ this ->result = Process::timeout ( $ timeout )-> run ($ this ->buildCommand ());
113113
114114 if ($ this ->deleteFiles ) {
115115 if ($ this ->logPath && File::exists ($ this ->logPath )) {
You can’t perform that action at this time.
0 commit comments