-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixes #190, prevent counting to infinity - thanks for trying though, …
…poor server
- Loading branch information
Showing
2 changed files
with
8 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,8 +66,12 @@ public function created_at_time() | |
*/ | ||
public function number_of_chunks() | ||
{ | ||
$config = OCConfig::getConfigForCourse(Context::getId()); | ||
return ceil($this->data['file']['size'] / $config['upload_chunk_size']); | ||
$config = OCConfig::getConfigForCourse($this->data['id_list']['course']); | ||
|
||
$chunks = ceil($this->data['file']['size'] / $config['upload_chunk_size']); | ||
|
||
// prevent counting to infinity, might take to long | ||
return !is_infinite($chunks) ?: 0; | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
tgloeggl
Author
Member
|
||
} | ||
|
||
/** | ||
|
@@ -160,7 +164,7 @@ public function load_media_package() | |
*/ | ||
public function load_opencast_job_id() | ||
{ | ||
$config = OCConfig::getConfigForCourse(Context::getId()); | ||
$config = OCConfig::getConfigForCourse($this->data['id_list']['course']); | ||
|
||
if (!$this->opencast_unloaded('media_package') && $this->opencast_unloaded('opencast_job_id')) { | ||
$opencast_job_id = $this->upload_client->newJob( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Are you sure returning
!is_infinite($chunks)
is desired here? See #210