Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_remove/update on a block not working. #13

Open
parthmehta opened this issue Sep 19, 2016 · 1 comment
Open

_remove/update on a block not working. #13

parthmehta opened this issue Sep 19, 2016 · 1 comment

Comments

@parthmehta
Copy link

parthmehta commented Sep 19, 2016

Hi,

Config example :

rtmp{
  server{

    application A{
      live on;
      #..othercommands
    }

    application B{
      live on;
      #..othercommands
    }

    application C{
      live on;
      #..othercommands
    }

  }
}

Have added application blocks using _addVerbatimBlock function. Currently, there is no update function. So, for updating, I remove the block and add it again. But the following remove functions does not work :

 conf.nginx.rtmp.server._remove("application A")
 conf.nginx.rtmp.server._remove("application A",0)
 conf.nginx.rtmp.server._remove("application", "A")

Which is the correct way to remove or update the block ?

  • Cant use index of application ( application[1] ) to remove.
@parthmehta parthmehta changed the title _remove on a block not working. _remove/update on a block not working. Sep 19, 2016
@parthmehta
Copy link
Author

Removed by looping over application array. I think we should have a function for the same. Will send a PR.

for(let i =0;i<conf.nginx.rtmp.server.application.length ; i++){
           let a = conf.nginx.rtmp.server.application[i]
           console.log(a._value,i)
           if(a._value.toString() == "B")){
                console.log("REMOVING",a._value)
                 conf.nginx.rtmp.server._remove("application",i)
           }
        }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant