ReadMaxLoad parses the `--max-load` flag, which is in multiple key-value format, such as: 'Threads_running=100,Threads_connected=500' It only applies changes in case there's no parsing error.
(maxLoadList string)
| 829 | // such as: 'Threads_running=100,Threads_connected=500' |
| 830 | // It only applies changes in case there's no parsing error. |
| 831 | func (mctx *MigrationContext) ReadMaxLoad(maxLoadList string) error { |
| 832 | loadMap, err := ParseLoadMap(maxLoadList) |
| 833 | if err != nil { |
| 834 | return err |
| 835 | } |
| 836 | mctx.throttleMutex.Lock() |
| 837 | defer mctx.throttleMutex.Unlock() |
| 838 | |
| 839 | mctx.maxLoad = loadMap |
| 840 | return nil |
| 841 | } |
| 842 | |
| 843 | // ReadCriticalLoad parses the `--max-load` flag, which is in multiple key-value format, |
| 844 | // such as: 'Threads_running=100,Threads_connected=500' |
no test coverage detected