Skip to content

Conversation

@pdmars
Copy link
Contributor

@pdmars pdmars commented Dec 13, 2016

No description provided.

Copy link
Member

@labisso labisso left a comment

Choose a reason for hiding this comment

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

The overall approach seems fine, aside from the comments/questions I added.

In general do you feel the existing tests are sufficient to cover these changes? I might be missing something, but I don't see any that create more than one blockade in a single deployment, so that seems like a gap.

global DATA_DIR
DATA_DIR = data_dir
BASE_BLOCKADE_DIR = os.path.join(DATA_DIR, ".blockade")
REST_STATE_FILE = os.path.join(BASE_BLOCKADE_DIR, "rest_state.yaml")
Copy link
Member

Choose a reason for hiding this comment

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

I think you need to declare these two as global if the changes are to stick. However, is there a reason to use global vars at all? Perhaps all three of these vars could be on the class instead?

BLOCKADE_CONFIGS[name] = config
rest_state = BlockadeManager.read_rest_state()
rest_state[name] = config
BlockadeManager.write_rest_state(rest_state)
Copy link
Member

Choose a reason for hiding this comment

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

I'm not too familiar with Flask - are there multiple request handler threads? If so this behavior seems racy. Concurrent requests could step on each other. delete_config too.

Base automatically changed from master to main March 20, 2021 17:08
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.

2 participants