Skip to content

fix dynamic branch pages #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 2, 2016

Conversation

flosell
Copy link
Contributor

@flosell flosell commented Jan 1, 2016

(related to flosell/lambdacd#76)

The issue was mainly compojure:

LambdaCDs ui-for returns a ring handler that responds to paths without a prefix, e.g. / to deliver the UI and /api for various endpoints the UI uses to get data.

compojure/GET just passes on the full path, so the LambdaCD ring-handler would receive requests for a path like /branch/master/api which it cannot resolve.
compojure/context gets rid of the prefix, fixing the issue.

The issue remaining was that each request would create a LambdaCD instance. I fixed this with a very crude cache-like approach: Mutable map from branch-name to pipeline-instance. If it exists return, otherwise create a new one and put it into the map.

It's probably not race-condition free (it could create branch-pages you never see) but it works as a proof of concept

jonocodes added a commit that referenced this pull request Jan 2, 2016
@jonocodes jonocodes merged commit 41ca540 into jonocodes:master Jan 2, 2016
@jonocodes
Copy link
Owner

Thanks!

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