Version 4.1.19
This commit is contained in:
1 parent
28bd025b35
commit
2bd5025018
2674 files changed
+233518
-77766
No files matched your search
@@ -2,10 +2,10 @@
|
||||
/**
|
||||
* @brief Background Task
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @subpackage
|
||||
* @package IPS Community Suite
|
||||
* @subpackage Downloads
|
||||
* @since 23 Sep 2014
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
@@ -27,16 +27,23 @@ class _Follow
|
||||
/**
|
||||
* Run Background Task
|
||||
*
|
||||
* @param mixed $data Data as it was passed to \IPS\Task::queue()
|
||||
* @param int $offset Offset
|
||||
* @return int|null New offset or NULL if complete
|
||||
* @throws \OutOfRangeException Indicates offset doesn't exist and thus task is complete
|
||||
* @param mixed $data Data as it was passed to \IPS\Task::queue()
|
||||
* @param int $offset Offset
|
||||
* @return int New offset
|
||||
* @throws \IPS\Task\Queue\OutOfRangeException Indicates offset doesn't exist and thus task is complete
|
||||
*/
|
||||
public function run( $data, $offset )
|
||||
{
|
||||
$category = \IPS\downloads\Category::load( $data['category_id'] );
|
||||
$member = \IPS\Member::load( $data['member_id'] );
|
||||
return \IPS\downloads\File::_sendNotificationsBatch( $category, $member, $offset );
|
||||
$newOffset = \IPS\downloads\File::_sendNotificationsBatch( $category, $member, $offset );
|
||||
|
||||
if( $newOffset === NULL )
|
||||
{
|
||||
throw new \IPS\Task\Queue\OutOfRangeException;
|
||||
}
|
||||
|
||||
return $newOffset;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -44,14 +51,14 @@ class _Follow
|
||||
*
|
||||
* @param mixed $data Data as it was passed to \IPS\Task::queue()
|
||||
* @param int $offset Offset
|
||||
* @return array( 'text' => 'Doing something...', 'complete' => 50 ) Text explaning task and percentage complete
|
||||
* @return array( 'text' => 'Doing something...', 'complete' => 50 ) Text explaining task and percentage complete
|
||||
* @throws \OutOfRangeException Indicates offset doesn't exist and thus task is complete
|
||||
*/
|
||||
public function getProgress( $data, $offset )
|
||||
{
|
||||
$numberOfFollowers = \IPS\downloads\File::_notificationRecipients()->count( TRUE );
|
||||
$numberOfFollowers = \IPS\downloads\File::_notificationRecipients( \IPS\downloads\Category::load( $data['category_id'] ) )->count( TRUE );
|
||||
|
||||
if ( $numberofFollowers )
|
||||
if ( $numberOfFollowers )
|
||||
{
|
||||
$complete = round( 100 / $numberOfFollowers * $offset, 2 );
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user