aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorFChannel <=>2021-01-24 12:12:13 -0800
committerFChannel <=>2021-01-24 12:12:13 -0800
commite3aac28acc5e776107c94c01a88bbd577380d6c5 (patch)
tree75388099aba22f85227d565e229f11530a8cc090 /main.go
parent895d90f8dd038540e65cf291f003195a0f6bd024 (diff)
more caching progress
Diffstat (limited to 'main.go')
-rw-r--r--main.go27
1 files changed, 14 insertions, 13 deletions
diff --git a/main.go b/main.go
index e9cdb2f..874dc4d 100644
--- a/main.go
+++ b/main.go
@@ -339,7 +339,7 @@ func main() {
resp, err := http.DefaultClient.Do(req)
- CheckError(err, "error with post form resp")
+ CheckError(err, "error with post form resp")
defer resp.Body.Close()
@@ -581,7 +581,6 @@ func main() {
CheckError(err, "error getting actor from body in new board")
//update board list with new instances following
- fmt.Println(resp.StatusCode)
if resp.StatusCode == 200 {
var board []ObjectBase
var item ObjectBase
@@ -751,8 +750,6 @@ func main() {
actor := GetActorFromPath(db, id, "/")
_, auth := GetPasswordFromSession(r)
- fmt.Println(actor.Id)
-
if id == "" || auth == "" {
w.WriteHeader(http.StatusBadRequest)
w.Write([]byte(""))
@@ -1387,11 +1384,14 @@ func IsObjectLocal(db *sql.DB, id string) bool {
query := `select id from activitystream where id=$1`
- rows, err := db.Query(query, id)
+ rows, _ := db.Query(query, id)
+ var nID string
defer rows.Close()
-
- if err != nil {
+ rows.Next()
+ rows.Scan(&nID)
+
+ if nID == "" {
return false
}
@@ -1401,15 +1401,18 @@ func IsObjectLocal(db *sql.DB, id string) bool {
func IsObjectCached(db *sql.DB, id string) bool {
query := `select id from cacheactivitystream where id=$1`
- rows, err := db.Query(query, id)
+ rows, _ := db.Query(query, id)
+ var nID string
defer rows.Close()
-
- if err != nil {
+ rows.Next()
+ rows.Scan(&nID)
+
+ if nID == "" {
return false
}
- return true
+ return true
}
func GetObjectFromActivity(activity Activity) ObjectBase {
@@ -1555,8 +1558,6 @@ func MakeActivityRequest(activity Activity) {
for _, e := range activity.To {
- fmt.Println(e)
-
actor := GetActor(e)
if actor.Inbox != "" {