Skip to content

Conversation

bdjilka
Copy link
Contributor

@bdjilka bdjilka commented Jan 24, 2023

No description provided.

@bdjilka bdjilka changed the title Improve auto reload for cqrs_consume [DON'T MERGE] Improve auto reload for cqrs_consume Jan 24, 2023
@bdjilka bdjilka force-pushed the feature/LITE-26314_improve_consume_reload branch 4 times, most recently from 887dc58 to 9906a27 Compare January 27, 2023 11:44
kwargs=self.consume_kwargs,
for _ in range(self.workers):
process = start_process(
self.transport.consume,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The target function of start_process must be a function like the following:

def consume(**kwargs):
    import django
    django.setup()
    from dj_cqrs import transport
    transport.current_transport.consume(**kwargs)

otherwise in "spawn" mode (that is the default for the start_process function) it will not work.

pass

signal.signal(signal.SIGHUP, workers_manager.reload)
signal.signal(signal.SIGHUP, workers_manager.reload)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to register signal handlers here they have already been registered in the run function of the workers manager.

@bdjilka bdjilka force-pushed the feature/LITE-26314_improve_consume_reload branch from 9906a27 to 7f1932e Compare January 30, 2023 10:41
@bdjilka bdjilka force-pushed the feature/LITE-26314_improve_consume_reload branch from 7f1932e to 602a073 Compare January 30, 2023 10:45
@ffaraone ffaraone self-requested a review January 30, 2023 10:57
@bdjilka bdjilka changed the title [DON'T MERGE] Improve auto reload for cqrs_consume Improve auto reload for cqrs_consume Jan 30, 2023
@bdjilka bdjilka requested review from maxipavlovic and d3rky January 30, 2023 11:01
@ffaraone ffaraone merged commit 854f5f8 into master Jan 30, 2023
@ffaraone ffaraone deleted the feature/LITE-26314_improve_consume_reload branch February 1, 2023 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants