1
0
mirror of https://github.com/ebosas/microservices.git synced 2025-06-12 22:17:26 +02:00

Cache, messages page

This commit is contained in:
ebosas
2021-10-10 18:49:39 +03:00
parent 5357502b71
commit 27e472d692
14 changed files with 184 additions and 389 deletions

View File

@ -58,7 +58,7 @@ func insertToDB(d amqp.Delivery, c *pgx.Conn) bool {
log.Fatalf("insert into database: %s", err)
}
// An alternative query that returns the id of the inserted row.
// // An alternative query that returns the id of the inserted row.
// var id int64
// err = c.QueryRow(context.Background(), "insert into messages (message, created) values ($1, to_timestamp($2)) returning id", message.Text, message.Time/1000).Scan(&id)
// if err != nil {
@ -66,9 +66,5 @@ func insertToDB(d amqp.Delivery, c *pgx.Conn) bool {
// }
// fmt.Println(id)
// For cache, could send messages from here instead
// of doing it from the server and backend services.
// err = <Rabbit conn>.Publish(conf.Exchange, conf.KeyCache, d.Body)
return true
}