downgraded csv writer ver
This commit is contained in:
parent
31e6492dbc
commit
99b56b3584
5 changed files with 10 additions and 11 deletions
|
@ -119,7 +119,7 @@ RUN mkdir -p /storage/uploads && \
|
||||||
RUN chmod +x /usr/local/bin/doctor && \
|
RUN chmod +x /usr/local/bin/doctor && \
|
||||||
chmod +x /usr/local/bin/patch-delete-schedule-updated-at-attribute && \
|
chmod +x /usr/local/bin/patch-delete-schedule-updated-at-attribute && \
|
||||||
chmod +x /usr/local/bin/clear-card-cache && \
|
chmod +x /usr/local/bin/clear-card-cache && \
|
||||||
chmod +x /usr/local/bin/users-calc && \
|
chmod +x /usr/local/bin/calc-users-stats && \
|
||||||
chmod +x /usr/local/bin/maintenance && \
|
chmod +x /usr/local/bin/maintenance && \
|
||||||
chmod +x /usr/local/bin/volume-sync && \
|
chmod +x /usr/local/bin/volume-sync && \
|
||||||
chmod +x /usr/local/bin/usage && \
|
chmod +x /usr/local/bin/usage && \
|
||||||
|
|
3
bin/calc-users-stats
Normal file
3
bin/calc-users-stats
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
php /usr/src/code/app/cli.php calc-users-stats $@
|
|
@ -1,3 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
php /usr/src/code/app/cli.php users-calc $@
|
|
|
@ -19,7 +19,7 @@ use Appwrite\Platform\Tasks\Usage;
|
||||||
use Appwrite\Platform\Tasks\Vars;
|
use Appwrite\Platform\Tasks\Vars;
|
||||||
use Appwrite\Platform\Tasks\Version;
|
use Appwrite\Platform\Tasks\Version;
|
||||||
use Appwrite\Platform\Tasks\VolumeSync;
|
use Appwrite\Platform\Tasks\VolumeSync;
|
||||||
use Appwrite\Platform\Tasks\UsersCalc;
|
use Appwrite\Platform\Tasks\CalcUsersStats;
|
||||||
|
|
||||||
class Tasks extends Service
|
class Tasks extends Service
|
||||||
{
|
{
|
||||||
|
@ -43,6 +43,6 @@ class Tasks extends Service
|
||||||
->addAction(SDKs::getName(), new SDKs())
|
->addAction(SDKs::getName(), new SDKs())
|
||||||
->addAction(VolumeSync::getName(), new VolumeSync())
|
->addAction(VolumeSync::getName(), new VolumeSync())
|
||||||
->addAction(Specs::getName(), new Specs())
|
->addAction(Specs::getName(), new Specs())
|
||||||
->addAction(UsersCalc::getName(), new UsersCalc());
|
->addAction(CalcUsersStats::getName(), new CalcUsersStats());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
namespace Appwrite\Platform\Tasks;
|
namespace Appwrite\Platform\Tasks;
|
||||||
|
|
||||||
use Exception;
|
use Exception;
|
||||||
use League\Csv\Reader;
|
|
||||||
use Utopia\App;
|
use Utopia\App;
|
||||||
use Utopia\Platform\Action;
|
use Utopia\Platform\Action;
|
||||||
use Utopia\Cache\Cache;
|
use Utopia\Cache\Cache;
|
||||||
|
@ -15,7 +14,7 @@ use PHPMailer\PHPMailer\PHPMailer;
|
||||||
use Utopia\Pools\Group;
|
use Utopia\Pools\Group;
|
||||||
use Utopia\Registry\Registry;
|
use Utopia\Registry\Registry;
|
||||||
|
|
||||||
class UsersCalc extends Action
|
class CalcUsersStats extends Action
|
||||||
{
|
{
|
||||||
private array $columns = [
|
private array $columns = [
|
||||||
'Project ID',
|
'Project ID',
|
||||||
|
@ -29,7 +28,7 @@ class UsersCalc extends Action
|
||||||
|
|
||||||
public static function getName(): string
|
public static function getName(): string
|
||||||
{
|
{
|
||||||
return 'users-calc';
|
return 'calc-users-stats';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
|
@ -48,6 +47,7 @@ class UsersCalc extends Action
|
||||||
|
|
||||||
public function action(Group $pools, Cache $cache, Database $dbForConsole, Registry $register): void
|
public function action(Group $pools, Cache $cache, Database $dbForConsole, Registry $register): void
|
||||||
{
|
{
|
||||||
|
//docker compose exec -t appwrite calc-users-stats
|
||||||
|
|
||||||
Console::title('Cloud Users calculation V1');
|
Console::title('Cloud Users calculation V1');
|
||||||
Console::success(APP_NAME . ' cloud Users calculation has started');
|
Console::success(APP_NAME . ' cloud Users calculation has started');
|
||||||
|
@ -141,7 +141,7 @@ class UsersCalc extends Action
|
||||||
try {
|
try {
|
||||||
/** Addresses */
|
/** Addresses */
|
||||||
$mail->setFrom(App::getEnv('_APP_SYSTEM_EMAIL_ADDRESS', APP_EMAIL_TEAM), 'Appwrite Cloud Hamster');
|
$mail->setFrom(App::getEnv('_APP_SYSTEM_EMAIL_ADDRESS', APP_EMAIL_TEAM), 'Appwrite Cloud Hamster');
|
||||||
$recipients = explode(',', App::getEnv('_APP_HAMSTER_RECIPIENTS', 'shimon@appwrite.io'));
|
$recipients = explode(',', App::getEnv('_APP_HAMSTER_RECIPIENTS', ''));
|
||||||
|
|
||||||
foreach ($recipients as $recipient) {
|
foreach ($recipients as $recipient) {
|
||||||
$mail->addAddress($recipient);
|
$mail->addAddress($recipient);
|
||||||
|
@ -153,7 +153,6 @@ class UsersCalc extends Action
|
||||||
/** Content */
|
/** Content */
|
||||||
$mail->Subject = "Cloud Report for {$this->date}";
|
$mail->Subject = "Cloud Report for {$this->date}";
|
||||||
$mail->Body = "Please find the daily cloud report atttached";
|
$mail->Body = "Please find the daily cloud report atttached";
|
||||||
|
|
||||||
$mail->send();
|
$mail->send();
|
||||||
Console::success('Email has been sent!');
|
Console::success('Email has been sent!');
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
Loading…
Reference in a new issue