Start starts the CachedSchemaHandler, if interval > 0, will start periodical refresh
(interval int)
| 95 | |
| 96 | // Start starts the CachedSchemaHandler, if interval > 0, will start periodical refresh |
| 97 | func (cf *CachedSchemaHandler) Start(interval int) { |
| 98 | cf.FetchSchemas() |
| 99 | |
| 100 | if interval <= 0 { |
| 101 | return |
| 102 | } |
| 103 | |
| 104 | go func(refreshInterval int) { |
| 105 | ticks := time.Tick(time.Duration(refreshInterval) * time.Second) |
| 106 | for range ticks { |
| 107 | cf.FetchSchemas() |
| 108 | } |
| 109 | }(interval) |
| 110 | return |
| 111 | } |
| 112 | |
| 113 | // TranslateEnum translates given enum value to its enumID |
| 114 | func (cf *CachedSchemaHandler) TranslateEnum(tableName string, columnID int, value interface{}, caseInsensitive bool) (enumID int, err error) { |
no test coverage detected