Browse Source

feat():mqtt_source.json -> mqtt.json (#499)

Co-authored-by: EMqmyd <mayuedong@emx.io>
EMQmyd 4 years atrás
parent
commit
eb0ab4bf4a
1 changed files with 4 additions and 1 deletions
  1. 4 1
      plugins/sourceMeta.go

+ 4 - 1
plugins/sourceMeta.go

@@ -28,7 +28,7 @@ type (
 )
 
 func isInternalSource(fiName string) bool {
-	internal := []string{`edgex.json`, `httppull.json`, `mqtt_source.json`}
+	internal := []string{`edgex.json`, `httppull.json`, `mqtt.json`}
 	for _, v := range internal {
 		if v == fiName {
 			return true
@@ -59,6 +59,9 @@ var g_sourceProperty map[string]*sourceProperty
 
 func (m *Manager) readSourceMetaFile(filePath string) error {
 	fileName := path.Base(filePath)
+	if "mqtt_source.json" == fileName {
+		fileName = "mqtt.json"
+	}
 	ptrMeta := new(fileSource)
 	err := common.ReadJsonUnmarshal(filePath, ptrMeta)
 	if nil != err || 0 == len(ptrMeta.ConfKeys) {