2019-01-31 14:26:28 +00:00
|
|
|
from git import Repo
|
|
|
|
from django_cron import CronJobBase, Schedule
|
|
|
|
from django.conf import settings
|
|
|
|
|
2019-04-21 07:40:14 +00:00
|
|
|
|
2019-01-31 14:26:28 +00:00
|
|
|
class FetchRemoteCron(CronJobBase):
|
|
|
|
schedule = Schedule(run_every_mins=5)
|
|
|
|
code = "manager.fetchremotecron"
|
|
|
|
|
|
|
|
def do(self):
|
|
|
|
repo = Repo(settings.BASE_DIR)
|
|
|
|
repo.remotes[0].fetch()
|