Skip to content

Add a --time-limit option for event-store:projection:run command #66

Open
@ambroisemaupate

Description

@ambroisemaupate

In production, bin/console event-store:projection:run command may be executed during a long time, we should be able to kill it after a given time in the same way Symfony Messenger consumers do to avoid PHP memory leaks. Then, using a process manager such as Supervisor to restart automatically worker

[program:eventstore-projection]
command=php /app/bin/console event-store:projection:run %(PROJECTION_NAME)s --time-limit=1800
autostart=true
autorestart=true
process_name=%(program_name)s_%(process_num)02d
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
redirect_stderr=true

[supervisord]
nodaemon=true

https://github.com/symfony/messenger/blob/master/Command/ConsumeMessagesCommand.php#L79

https://github.com/symfony/messenger/blob/master/Worker/StopWhenTimeLimitIsReachedWorker.php

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions