# \[solved\] Deploying - function node change the status (even the condition ist not true)

**URL:** <https://discourse.nodered.org/t/solved-deploying-function-node-change-the-status-even-the-condition-ist-not-true/44534>\
**Category:** General\
**Created:** [22 April 2021 10:20 UTC](https://discourse.nodered.org/t/solved-deploying-function-node-change-the-status-even-the-condition-ist-not-true/44534 "2021-04-22T10:20:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![steinerma](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steinerma/32/37666_2.png) [@steinerma](https://discourse.nodered.org/u/steinerma)\
**Post date:** [22 April 2021 10:20 UTC](https://discourse.nodered.org/t/solved-deploying-function-node-change-the-status-even-the-condition-ist-not-true/44534/1 "2021-04-22T10:20:52Z")

</div>

hi, every time I redeploy (full), this "function node" sends me a "true" for a short time, even if the condition is not true. How can I prevent this?

```auto
[{"id":"ec8d8697.cb8028","type":"function","z":"df764457.a3c8e8","name":"Date/Time mail","func":"var D1 = msg.header.date.valueOf(); //email epoch\nvar now = Date.now(); //now epoch\nvar diff = Math.abs(D1 - now) / 1000; //get difference in seconds\nmsg.payload = (diff < 130); //true if < 130s otherwise false.\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":720,"y":660,"wires":[["23e8c96b.4c4856","491da051.da7fa"]]}]

```

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [22 April 2021 10:31 UTC](https://discourse.nodered.org/t/solved-deploying-function-node-change-the-status-even-the-condition-ist-not-true/44534/2 "2021-04-22T10:31:22Z")

</div>

The function node will not sending anything without a msg being fired into it - so it is responding to whatever you feed into it.

If you have an inject set to run at start up. Either disable it or set its topic so you can determine when the msg is a startup msg.

---

<div class="post-metadata">

**Author:** ![steinerma](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steinerma/32/37666_2.png) [@steinerma](https://discourse.nodered.org/u/steinerma)\
**Post date:** [22 April 2021 14:45 UTC](https://discourse.nodered.org/t/solved-deploying-function-node-change-the-status-even-the-condition-ist-not-true/44534/3 "2021-04-22T14:45:29Z")

</div>

Thanks a lot!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [6 May 2021 14:46 UTC](https://discourse.nodered.org/t/solved-deploying-function-node-change-the-status-even-the-condition-ist-not-true/44534/4 "2021-05-06T14:46:05Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
