Skip to content
This repository has been archived by the owner on Nov 26, 2018. It is now read-only.

Commit

Permalink
Rename the method receiver for *PostgresStorage from ms to PS
Browse files Browse the repository at this point in the history
  • Loading branch information
yml committed Apr 9, 2015
1 parent 4146099 commit 61b5e64
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions common/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,15 @@ func NewPostgresStorage() *PostgresStorage {
return &PostgresStorage{db}
}

func (ms *PostgresStorage) BotConfig() []*BotConfig {
func (ps *PostgresStorage) BotConfig() []*BotConfig {

var err error
var rows *sql.Rows

configs := make([]*BotConfig, 0)

sql := "SELECT id, server, server_password, nick, password, real_name, server_identifier FROM bots_chatbot WHERE is_active=true"
rows, err = ms.db.Query(sql)
rows, err = ps.db.Query(sql)
if err != nil {
glog.Fatal("Error running: ", sql, " ", err)
}
Expand Down Expand Up @@ -120,7 +120,7 @@ func (ms *PostgresStorage) BotConfig() []*BotConfig {
configs = append(configs, config)
glog.Infoln("config.Id:", config.Id)
}
channelStmt, err := ms.db.Prepare("SELECT id, name, password, fingerprint FROM bots_channel WHERE is_active=true and chatbot_id=$1")
channelStmt, err := ps.db.Prepare("SELECT id, name, password, fingerprint FROM bots_channel WHERE is_active=true and chatbot_id=$1")
if err != nil {
glog.Fatal("[Error] Error while preparing the statements to retrieve the channel:", err)
}
Expand Down Expand Up @@ -159,7 +159,6 @@ func (ms *PostgresStorage) SetCount(channel string, count int) error {
}

// Write the count

updateSQL := "UPDATE bots_usercount SET counts[$1] = $2 WHERE channel_id = $3 AND dt = $4"

var res sql.Result
Expand Down

0 comments on commit 61b5e64

Please sign in to comment.