Removed logging
This commit is contained in:
parent
99b882aad2
commit
d5f9d4bd46
|
@ -3,10 +3,6 @@ Credits go to github.com/SlyMarbo/rss for inspiring this solution.
|
||||||
*/
|
*/
|
||||||
package feeder
|
package feeder
|
||||||
|
|
||||||
import (
|
|
||||||
"fmt"
|
|
||||||
)
|
|
||||||
|
|
||||||
type database struct {
|
type database struct {
|
||||||
request chan string
|
request chan string
|
||||||
response chan bool
|
response chan bool
|
||||||
|
@ -20,10 +16,8 @@ func (d *database) Run() {
|
||||||
for {
|
for {
|
||||||
s = <-d.request
|
s = <-d.request
|
||||||
if _, ok := d.known[s]; ok {
|
if _, ok := d.known[s]; ok {
|
||||||
fmt.Println("Database used: true")
|
|
||||||
d.response <- true
|
d.response <- true
|
||||||
} else {
|
} else {
|
||||||
fmt.Println("Database used: false")
|
|
||||||
d.response <- false
|
d.response <- false
|
||||||
d.known[s] = struct{}{}
|
d.known[s] = struct{}{}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,5 @@
|
||||||
package feeder
|
package feeder
|
||||||
|
|
||||||
import (
|
|
||||||
"fmt"
|
|
||||||
)
|
|
||||||
|
|
||||||
type databaseHandler struct {
|
type databaseHandler struct {
|
||||||
db *database
|
db *database
|
||||||
itemhandler ItemHandler
|
itemhandler ItemHandler
|
||||||
|
@ -11,7 +7,6 @@ type databaseHandler struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *databaseHandler) ProcessItems(f *Feed, ch *Channel, items []*Item) {
|
func (d *databaseHandler) ProcessItems(f *Feed, ch *Channel, items []*Item) {
|
||||||
fmt.Println("Processing items")
|
|
||||||
var newitems []*Item
|
var newitems []*Item
|
||||||
for _, item := range items {
|
for _, item := range items {
|
||||||
if d.db.request <- item.Key(); !<-d.db.response {
|
if d.db.request <- item.Key(); !<-d.db.response {
|
||||||
|
@ -26,7 +21,6 @@ func (d *databaseHandler) ProcessItems(f *Feed, ch *Channel, items []*Item) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *databaseHandler) ProcessChannels(f *Feed, ch []*Channel) {
|
func (d *databaseHandler) ProcessChannels(f *Feed, ch []*Channel) {
|
||||||
fmt.Println("Processing channels")
|
|
||||||
var newchannels []*Channel
|
var newchannels []*Channel
|
||||||
for _, channel := range ch {
|
for _, channel := range ch {
|
||||||
if d.db.request <- channel.Key(); !<-d.db.response {
|
if d.db.request <- channel.Key(); !<-d.db.response {
|
||||||
|
|
Loading…
Reference in New Issue