diff --git a/glide.lock b/glide.lock index 7b75dbd699..984f3dd9aa 100644 --- a/glide.lock +++ b/glide.lock @@ -1,5 +1,5 @@ -hash: 8abe00d58923fa7855f666aac2a2ee1636aad6734c05e3b9895a084ff0f1b56c -updated: 2017-06-20T15:53:07.620238453-07:00 +hash: 4c29ee4e38944411744a2a1af3e71836591d28feea24b328ab3d440a9ad1cef0 +updated: 2017-06-23T08:58:13.944294825-04:00 imports: - name: github.com/alecthomas/log4go version: 3fbce08846379ec7f4f6bc7fce6dd01ce28fae4c @@ -83,7 +83,7 @@ imports: - name: github.com/magiconair/properties version: 51463bfca2576e06c62a8504b5c0f06d61312647 - name: github.com/mattermost/gorp - version: cab337059e349c91a4b917c9be50708813619543 + version: 995ddf2264c4ad45fbaf342f7500e4787ebae84a - name: github.com/mattermost/rsc version: bbaefb05eaa0389ea712340066837c8ce4d287f9 subpackages: diff --git a/glide.yaml b/glide.yaml index 63647b0c98..3f617c997c 100644 --- a/glide.yaml +++ b/glide.yaml @@ -82,4 +82,4 @@ import: - package: gopkg.in/olivere/elastic.v5 version: v5.0.41 - package: github.com/mattermost/gorp - version: cab337059e349c91a4b917c9be50708813619543 \ No newline at end of file + version: 995ddf2264c4ad45fbaf342f7500e4787ebae84a diff --git a/vendor/github.com/mattermost/gorp/.gitignore b/vendor/github.com/mattermost/gorp/.gitignore index d18c8ca701..c1bbd21d1f 100644 --- a/vendor/github.com/mattermost/gorp/.gitignore +++ b/vendor/github.com/mattermost/gorp/.gitignore @@ -7,3 +7,4 @@ _obj 6.out gorptest.bin tmp +*.swp diff --git a/vendor/github.com/mattermost/gorp/gorp.go b/vendor/github.com/mattermost/gorp/gorp.go index 728971e48c..784712fd9a 100644 --- a/vendor/github.com/mattermost/gorp/gorp.go +++ b/vendor/github.com/mattermost/gorp/gorp.go @@ -173,13 +173,9 @@ func exec(e SqlExecutor, query string, doTimeout bool, args ...interface{}) (sql query, args = maybeExpandNamedQuery(dbMap, query, args) } - if doTimeout && dbMap.Dialect.Name() != "PostgresDialect" { - ctx, cancel := context.WithTimeout(context.Background(), dbMap.QueryTimeout) - defer cancel() - return executor.ExecContext(ctx, query, args...) - } else { - return executor.Exec(query, args...) - } + ctx, cancel := context.WithTimeout(context.Background(), dbMap.QueryTimeout) + defer cancel() + return executor.ExecContext(ctx, query, args...) } // maybeExpandNamedQuery checks the given arg to see if it's eligible to be used @@ -410,14 +406,9 @@ func get(m *DbMap, exec SqlExecutor, i interface{}, dest[x] = target } - var row *sql.Row - if m.Dialect.Name() != "PostgresDialect" { - ctx, cancel := context.WithTimeout(context.Background(), m.QueryTimeout) - defer cancel() - row = exec.QueryRowContext(ctx, plan.query, keys...) - } else { - row = exec.QueryRow(plan.query, keys...) - } + ctx, cancel := context.WithTimeout(context.Background(), m.QueryTimeout) + defer cancel() + row := exec.QueryRowContext(ctx, plan.query, keys...) err = row.Scan(dest...) if err != nil { diff --git a/vendor/github.com/mattermost/gorp/select.go b/vendor/github.com/mattermost/gorp/select.go index 1967b02465..10c84b0844 100644 --- a/vendor/github.com/mattermost/gorp/select.go +++ b/vendor/github.com/mattermost/gorp/select.go @@ -167,15 +167,9 @@ func selectVal(e SqlExecutor, holder interface{}, query string, args ...interfac query, args = maybeExpandNamedQuery(dbMap, query, args) } - var rows *sql.Rows - var err error - if dbMap.Dialect.Name() != "PostgresDialect" { - ctx, cancel := context.WithTimeout(context.Background(), dbMap.QueryTimeout) - defer cancel() - rows, err = e.QueryContext(ctx, query, args...) - } else { - rows, err = e.Query(query, args...) - } + ctx, cancel := context.WithTimeout(context.Background(), dbMap.QueryTimeout) + defer cancel() + rows, err := e.QueryContext(ctx, query, args...) if err != nil { return err @@ -267,14 +261,9 @@ func rawselect(m *DbMap, exec SqlExecutor, i interface{}, query string, } // Run the query - var rows *sql.Rows - if m.Dialect.Name() != "PostgresDialect" { - ctx, cancel := context.WithTimeout(context.Background(), m.QueryTimeout) - defer cancel() - rows, err = exec.QueryContext(ctx, query, args...) - } else { - rows, err = exec.Query(query, args...) - } + ctx, cancel := context.WithTimeout(context.Background(), m.QueryTimeout) + defer cancel() + rows, err := exec.QueryContext(ctx, query, args...) if err != nil { return nil, err diff --git a/webapp/components/admin_console/database_settings.jsx b/webapp/components/admin_console/database_settings.jsx index 7b8891b2aa..e182db70ec 100644 --- a/webapp/components/admin_console/database_settings.jsx +++ b/webapp/components/admin_console/database_settings.jsx @@ -142,7 +142,7 @@ export default class DatabaseSettings extends AdminSettings { helpText={ } value={this.state.queryTimeout} diff --git a/webapp/i18n/en.json b/webapp/i18n/en.json index 419486b9d9..b1f688e40a 100755 --- a/webapp/i18n/en.json +++ b/webapp/i18n/en.json @@ -832,7 +832,7 @@ "admin.sql.maxOpenTitle": "Maximum Open Connections:", "admin.sql.noteDescription": "Changing properties in this section will require a server restart before taking effect.", "admin.sql.noteTitle": "Note:", - "admin.sql.queryTimeoutDescription": "The number of seconds to wait for a response from the database after opening a connection and sending the query. Errors that you see in the UI or in the logs as a result of a query timeout can vary depending on the type of query. This setting has no effect on PostgreSQL databases.", + "admin.sql.queryTimeoutDescription": "The number of seconds to wait for a response from the database after opening a connection and sending the query. Errors that you see in the UI or in the logs as a result of a query timeout can vary depending on the type of query.", "admin.sql.queryTimeoutExample": "E.g.: \"30\"", "admin.sql.queryTimeoutTitle": "Query Timeout:", "admin.sql.replicas": "Data Source Replicas:",