MCPcopy Index your code
hub / github.com/syncthing/syncthing / postDBScan

Method postDBScan

lib/api/api.go:1535–1558  ·  view source on GitHub ↗
(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

1533}
1534
1535func (s *service) postDBScan(w http.ResponseWriter, r *http.Request) {
1536 qs := r.URL.Query()
1537 folder := qs.Get("folder")
1538 if folder != "" {
1539 subs := qs["sub"]
1540 err := s.model.ScanFolderSubdirs(folder, subs)
1541 if err != nil {
1542 http.Error(w, err.Error(), http.StatusInternalServerError)
1543 return
1544 }
1545 nextStr := qs.Get("next")
1546 next, err := strconv.Atoi(nextStr)
1547 if err == nil {
1548 s.model.DelayScan(folder, time.Duration(next)*time.Second)
1549 }
1550 } else {
1551 errors := s.model.ScanFolders()
1552 if len(errors) > 0 {
1553 http.Error(w, "Error scanning folders", http.StatusInternalServerError)
1554 sendJSON(w, errors)
1555 return
1556 }
1557 }
1558}
1559
1560func (s *service) postDBPrio(w http.ResponseWriter, r *http.Request) {
1561 qs := r.URL.Query()

Callers

nothing calls this directly

Calls 6

sendJSONFunction · 0.85
GetMethod · 0.65
ScanFolderSubdirsMethod · 0.65
ErrorMethod · 0.65
DelayScanMethod · 0.65
ScanFoldersMethod · 0.65

Tested by

no test coverage detected