about summary refs log tree commit diff
diff options
context:
space:
mode:
authorhanemile <hanemile@protonmail.com>2019-01-21 21:06:53 +0100
committerhanemile <hanemile@protonmail.com>2019-01-21 21:06:53 +0100
commit1dcb503545016a9783968a2508d2244c6e376557 (patch)
treedbdb589d2380ff3e8deed515a1b30a246422cdd8
parent2c453958128358fe81aa63f7722a31fb314d3bcb (diff)
.
-rw-r--r--main.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/main.go b/main.go
index 1d19922..6c8260a 100644
--- a/main.go
+++ b/main.go
@@ -64,6 +64,12 @@ func indexHandler(w http.ResponseWriter, r *http.Request) {
 }
 
 // calcallforcesHandler calculates all the forces acting on a given star
+//
+// 1. read the tree index
+// 2. If the tree is not in the local cache
+// 2.1. Get the tree
+// 3. Calculate all the forces acting the given theta
+// 4. Write the forces to a file
 func calcallforcesHandler(w http.ResponseWriter, r *http.Request) {
 	fmt.Println("The calcallforcesHandler was accessed!")
 
@@ -86,7 +92,7 @@ func calcallforcesHandler(w http.ResponseWriter, r *http.Request) {
 			log.Println("[ ! ] The tree is not in local cache, requesting it from the database")
 
 			// make a http-post request to the databse requesting the tree
-			requesturl := fmt.Sprintf("http://%s/dumptree/%d", os.Getenv("DATABASE"), treeindex)
+			requesturl := fmt.Sprintf("http://%s/dumptree/%d", "db", treeindex)
 			log.Println("[   ] Requesting the tree from the database")
 			resp, err := http.Get(requesturl)
 			if err != nil {