Exemplo n.º 1
0
    def run(self):
        cause_options = self.cause_agent.options or {}
        cause_options.update({
            k: v
            for k, v in self.cause_options.items() if not k.startswith('_')
        })
        cause_options['task_pair_id'] = self.id
        effect_options = self.effect_agent.options or {}
        effect_options.update({
            k: v
            for k, v in self.effect_options.items() if not k.startswith('_')
        })
        effect_options['task_pair_id'] = self.id

        cause = self.cause.s(**cause_options)

        if getattr(self.cause, 'dedup_key', None) is not None:
            effect = dedup_effect_wrapper.s(
                dedup_key=self.cause.dedup_key,
                task_pair_id=self.id,
                effect=self.effect.s(**effect_options),
            )
        else:
            effect = self.effect.s(**effect_options)

        return chain(cause, dmap.s(effect))()
Exemplo n.º 2
0
    def populate_dedup_events(self):
        if getattr(self.cause, 'dedup_key', None) is not None:
            cause_options = self.cause_agent.options or {}
            cause_options.update({k: v for k, v in self.cause_options.items()
                                if not k.startswith('_')})
            cause_options['task_pair_id'] = self.id

            cause = self.cause.s(**cause_options)
            effect = create_dedup_event.s(task_pair_id=self.id,
                                        dedup_key=self.cause.dedup_key)
            return chain(cause, dmap.s(effect))()
Exemplo n.º 3
0
    def populate_dedup_events(self):
        if getattr(self.cause, 'dedup_key', None) is not None:
            cause_options = self.cause_agent.options or {}
            cause_options.update({
                k: v
                for k, v in self.cause_options.items() if not k.startswith('_')
            })
            cause_options['task_pair_id'] = self.id

            cause = self.cause.s(**cause_options)
            effect = create_dedup_event.s(task_pair_id=self.id,
                                          dedup_key=self.cause.dedup_key)
            return chain(cause, dmap.s(effect))()
Exemplo n.º 4
0
    def run(self):
        cause_options = self.cause_agent.options or {}
        cause_options.update({k: v for k, v in self.cause_options.items()
                              if not k.startswith('_')})
        cause_options['task_pair_id'] = self.id
        effect_options = self.effect_agent.options or {}
        effect_options.update({k: v for k, v in self.effect_options.items()
                               if not k.startswith('_')})
        effect_options['task_pair_id'] = self.id

        cause = self.cause.s(**cause_options)

        if getattr(self.cause, 'dedup_key', None) is not None:
            effect = dedup_effect_wrapper.s(
                dedup_key=self.cause.dedup_key,
                task_pair_id=self.id,
                effect=self.effect.s(**effect_options),
            )
        else:
            effect = self.effect.s(**effect_options)

        return chain(cause, dmap.s(effect))()