Skip to content
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

lib/db, lib/model: Create temp sorting database in config dir (fixes #3449) #3454

Closed
wants to merge 1 commit into from

Conversation

calmh
Copy link
Member

@calmh calmh commented Jul 27, 2016

Purpose

Create temp databases beside main database.

A design issue here is that the index sorter is created at a point quite far in the call stack from the closest place or even package that knows anything about disk paths. My solution takes a quite circuitous path via letting the main database know where it lives and have the model check that when it kicks of the index sending routines... I'm all open for suggestions on better ways to do this.

Testing

STTRACE=model, the log "opened sorter" line shows the expected path.

@plouj
Copy link
Contributor

plouj commented Jul 27, 2016

I might be confunsing golang with python, but Is it possible to store the db location in a package-global variable within the model package rather than needlessly passing it around the sendIndexes and sendIndexTo functions?

@AudriusButkevicius
Copy link
Member

Global state is evils

@calmh
Copy link
Member Author

calmh commented Jul 27, 2016

That could be one option. Another would be to move the "locations" stuff that now lives in package main to package config, possibly.

@AudriusButkevicius
Copy link
Member

@st-review merge

@st-review
Copy link

👌 Merged as 72026db. Thanks, @calmh!

st-review pushed a commit that referenced this pull request Jul 27, 2016
@st-review st-review closed this Jul 27, 2016
@calmh calmh deleted the fix-3449 branch August 5, 2016 09:56
@st-review st-review added the frozen-due-to-age Issues closed and untouched for a long time, together with being locked for discussion label Jul 28, 2017
@syncthing syncthing locked and limited conversation to collaborators Jul 28, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
frozen-due-to-age Issues closed and untouched for a long time, together with being locked for discussion
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants