rebar3_cuttlefish icon indicating copy to clipboard operation
rebar3_cuttlefish copied to clipboard

Generate config only if we need it, do not generate for commands like remote_console/ping

Open MikhailKalashnikov opened this issue 7 years ago • 2 comments

Cuttlefish generates new config (and delete old) when we run any command, even if new config files are not required. I start app with 'bin/appname start' command. Cuttlefish generates new config in generated.conf and application starts with this config. Then I use remote_console/ping to check my app. For each call remote_console (and any other command) Cuttlefish generates new config again and deletes the old config files (when we have more than max_history files). As a result after several remote_console command Cuttlefish deletes config which was created during the app start. We do not restart app but config files have been deleted. So we do not know exactly which config was used for the app start.

MikhailKalashnikov avatar Jun 08 '17 13:06 MikhailKalashnikov

What about the start command? And what if the release was never started so the config was never generated? Sure the other commands will fail if it isn't running, but now it will fail in a different way that could be more confusing?

But I like the idea.

tsloughter avatar Jun 23 '17 19:06 tsloughter

start command actually calls console command so new config will be generated when we call start.

start|start_boot)
        CMD=$1
        case "$1" in
            start)
                shift
                START_OPTION="console" ####      WE SET CONSOLE COMMAND HERE
                HEART_OPTION="start"
                ;;
            start_boot)
                shift
                START_OPTION="console_boot"
                HEART_OPTION="start_boot"
                ;;
        esac

For other commands we do not need config, so even if config never generated we get normal errors. For example: ping - Node '[email protected]' not responding to pings. remote_console - Node is not running!

MikhailKalashnikov avatar Jun 27 '17 13:06 MikhailKalashnikov