Exemple #1
0
    def apply(self, *args, **kwargs):
        """Automatically create task_id's based off of new primary keys in the
       database. Ignores specified task_id. I decided that was best"""
        kwargs.setdefault("task_id", None)
        if not kwargs["task_id"]:
            print "apply"
            kwargs["task_id"] = vip_unique_id(
                status="Creating Sync", inputs=json.dumps((args, kwargs)), serviceName=self.name
            )
        else:
            service_instance = get_service_instance(kwargs["task_id"])
            service_instance.status = "Creating Sync"
            service_instance.inputs = json.dumps((args, kwargs))
            service_instance.serviceName = self.name
            service_instance.save()

        if "VIP_CELERY_DBSTOP_ON_START" in env:
            import re

            if re.search(env["VIP_CELERY_DBSTOP_ON_START"], self.name):
                import vsi.tools.vdb_rpdb as vdb

                vdb.set_trace()

        return super(VipTask, self).apply(*args, **kwargs)
Exemple #2
0
  def apply(self, *args, **kwargs):
    '''Automatically create task_id's based off of new primary keys in the
       database. Ignores specified task_id. I decided that was best''' 
    kwargs.setdefault('task_id', None)
    if not kwargs['task_id']:
      print 'apply'
      kwargs['task_id'] = vip_unique_id(status='Creating Sync',
                                        inputs=json.dumps((args, kwargs)),
                                        serviceName=self.name)
    else:
      service_instance = get_service_instance(kwargs['task_id'])
      service_instance.status='Creating Sync'
      service_instance.inputs=json.dumps((args, kwargs))
      service_instance.serviceName=self.name
      service_instance.save()

    if 'VIP_CELERY_DBSTOP_ON_START' in env:
      import re
      if re.search(env['VIP_CELERY_DBSTOP_ON_START'], self.name):
        import vsi.tools.vdb_rpdb as vdb
        vdb.set_trace()

    return super(VipTask, self).apply(*args, **kwargs)
Exemple #3
0
    def apply_async(self, args=None, kwargs=None, task_id=None, *args2, **kwargs2):
        """Automatically create task_id's based off of new primary keys in the
       database. Ignores specified task_id. I decided that was best"""

        if not task_id:
            print "apply_async"
            task_id = vip_unique_id(status="Creating Async", inputs=json.dumps((args, kwargs)), serviceName=self.name)
        else:  # This only really happens in VIP in a canvas
            service_instance = get_service_instance(task_id)
            service_instance.status = "Creating Async"
            service_instance.inputs = json.dumps((args, kwargs))
            service_instance.serviceName = self.name
            service_instance.save()

        if "VIP_CELERY_DBSTOP_ON_START" in env:
            import re

            if re.search(env["VIP_CELERY_DBSTOP_ON_START"], self.name):
                import vsi.tools.vdb_rpdb as vdb

                vdb.set_trace()

        return super(VipTask, self).apply_async(args=args, kwargs=kwargs, task_id=task_id, *args2, **kwargs2)
Exemple #4
0
  def apply_async(self, args=None, kwargs=None, task_id=None, *args2, **kwargs2):
    '''Automatically create task_id's based off of new primary keys in the
       database. Ignores specified task_id. I decided that was best''' 

    if not task_id:
      print 'apply_async'
      task_id = vip_unique_id(status='Creating Async',
                              inputs=json.dumps((args, kwargs)),
                              serviceName=self.name)
    else:#This only really happens in VIP in a canvas
      service_instance = get_service_instance(task_id)
      service_instance.status='Creating Async'
      service_instance.inputs=json.dumps((args, kwargs))
      service_instance.serviceName=self.name
      service_instance.save()

    if 'VIP_CELERY_DBSTOP_ON_START' in env:
      import re
      if re.search(env['VIP_CELERY_DBSTOP_ON_START'], self.name):
        import vsi.tools.vdb_rpdb as vdb
        vdb.set_trace()

    return super(VipTask, self).apply_async(args=args, kwargs=kwargs, 
                                            task_id=task_id, *args2, **kwargs2)