@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

variable days back for `bin/mail volume`

Summary:
Email is so exciting I can't wait 30 days for initial results.

ref T9161

Test Plan:
* `./bin/mail volume --days 60` took longer and gave plausibly larger
results.
* `./bin/mail volume --days 0` quickly told me no mail had been sent.
* `./bin/mail volume` Said it was still looking 30 days back.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley

Maniphest Tasks: T9161

Differential Revision: https://secure.phabricator.com/D13901

authored by

cburroughs and committed by
epriestley
786b135a 328d336c

+26 -3
+21 -3
src/applications/metamta/management/PhabricatorMailManagementVolumeWorkflow.php
··· 7 7 $this 8 8 ->setName('volume') 9 9 ->setSynopsis( 10 - pht('Show how much mail users have received in the last 30 days.')) 10 + pht('Show how much mail users have received recently.')) 11 11 ->setExamples( 12 12 '**volume**') 13 13 ->setArguments( 14 14 array( 15 + array( 16 + 'name' => 'days', 17 + 'param' => 'days', 18 + 'default' => 30, 19 + 'help' => pht( 20 + 'Number of days back (default 30).'), 21 + ), 15 22 )); 16 23 } 17 24 ··· 19 26 $console = PhutilConsole::getConsole(); 20 27 $viewer = $this->getViewer(); 21 28 22 - $since = (PhabricatorTime::getNow() - phutil_units('30 days in seconds')); 29 + $days = (int)$args->getArg('days'); 30 + if ($days < 1) { 31 + throw new PhutilArgumentUsageException( 32 + pht( 33 + 'Period specified with --days must be at least 1.')); 34 + } 35 + 36 + $duration = phutil_units("{$days} days in seconds"); 37 + 38 + $since = (PhabricatorTime::getNow() - $duration); 23 39 $until = PhabricatorTime::getNow(); 24 40 25 41 $mails = id(new PhabricatorMetaMTAMailQuery()) ··· 95 111 $table->draw(); 96 112 97 113 echo "\n"; 98 - echo pht('Mail sent in the last 30 days.')."\n"; 114 + echo pht( 115 + 'Mail sent in the last %s day(s).', 116 + new PhutilNumber($days))."\n"; 99 117 echo pht( 100 118 '"Unfiltered" is raw volume before rules applied.')."\n"; 101 119 echo pht(
+5
src/infrastructure/internationalization/translation/PhabricatorUSEnglishTranslation.php
··· 1369 1369 'This action has no effect on targets: %2$s.', 1370 1370 ), 1371 1371 1372 + 'Mail sent in the last %s day(s).' => array( 1373 + 'Mail sent in the last day.', 1374 + 'Mail sent in the last %s days.', 1375 + ), 1376 + 1372 1377 ); 1373 1378 } 1374 1379