def register_birth(self):  # noqa
        self.log.debug('Registering birth of worker %s' % (self.calculated_name,))
        with transaction.commit_on_success(using=self.connection):
            if Worker.objects.using(self.connection).filter(name=self.calculated_name)[:]:
                raise ValueError(
                        'There exists an active worker named \'%s\' '
                        'already.' % (self.calculated_name,))
            self.name = self.calculated_name
            self.birth = now()
            self.queue_names = ','.join(self.get_queue_names())
            self.expire = self.default_worker_ttl
            self._clear_expired = now()
            self.save()
        # clear out any expired workers
        Worker.objects.filter(
            heartbeat__lte=now())\
            .delete()
Registers its own birth, saving to Postgres
dataset/ETHPy150Open bretth/django-pq/pq/worker.py/Worker.register_birth