misc: include current tenant name in cron process title (#70908)

This commit is contained in:
Frédéric Péters 2022-10-31 21:21:28 +01:00
parent 5d8f4e8d6b
commit d14312f3f8
3 changed files with 5 additions and 0 deletions

1
debian/control vendored
View File

@ -30,6 +30,7 @@ Depends: graphviz,
python3-pyproj,
python3-quixote,
python3-requests,
python3-setproctitle,
python3-unidecode,
python3-uwsgidecorators,
python3-vobject,

View File

@ -195,6 +195,7 @@ setup(
'python-magic',
'workalendar',
'requests',
'setproctitle',
],
package_dir={'wcs': 'wcs'},
packages=find_packages(),

View File

@ -15,7 +15,9 @@
# along with this program; if not, see <http://www.gnu.org/licenses/>.
import datetime
import sys
import setproctitle
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from django.utils.timezone import now
@ -98,6 +100,7 @@ class Command(BaseCommand):
if verbosity > 1:
print(hostname, 'skip running, already handled')
continue
setproctitle.setproctitle(sys.argv[0] + ' cron [%s]' % hostname)
if verbosity > 1:
print('cron work on %s' % hostname)
CronJob.log('start')