[icinga-checkins] icinga.org: icinga2/master: Implement the System#sleep function

git at icinga.org git at icinga.org
Fri Aug 12 15:22:11 CEST 2016


Module: icinga2
Branch: master
Commit: 12ea2a64455d2b1ffa725a86e5d9f2a39dc1f56d
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=12ea2a64455d2b1ffa725a86e5d9f2a39dc1f56d

Author: Gunnar Beutner <gunnar.beutner at netways.de>
Date:   Fri Aug 12 15:21:28 2016 +0200

Implement the System#sleep function

fixes #12411

---

 doc/19-library-reference.md |    1 +
 lib/base/scriptutils.cpp    |    1 +
 2 files changed, 2 insertions(+)

diff --git a/doc/19-library-reference.md b/doc/19-library-reference.md
index 087a3c2..2ac0914 100644
--- a/doc/19-library-reference.md
+++ b/doc/19-library-reference.md
@@ -26,6 +26,7 @@ escape\_shell\_arg(text)        | Escapes a string for use as a single shell arg
 escape\_shell\_cmd(text)        | Escapes shell meta characters in a string.
 escape\_create\_process\_arg(text)| (Windows only) Escapes a string for use as an argument for CreateProcess().
 exit(integer)                   | Terminates the application.
+sleep(interval)                 | Sleeps for the specified amount of time (in seconds).
 
 ## <a id="object-accessor-functions"></a> Object Accessor Functions
 
diff --git a/lib/base/scriptutils.cpp b/lib/base/scriptutils.cpp
index d27f6e5..5d99c3d 100644
--- a/lib/base/scriptutils.cpp
+++ b/lib/base/scriptutils.cpp
@@ -66,6 +66,7 @@ REGISTER_SAFE_SCRIPTFUNCTION_NS(System, escape_shell_arg, &Utility::EscapeShellA
 REGISTER_SAFE_SCRIPTFUNCTION_NS(System, escape_create_process_arg, &Utility::EscapeCreateProcessArg);
 #endif /* _WIN32 */
 REGISTER_SCRIPTFUNCTION_NS(System, ptr, &ScriptUtils::Ptr);
+REGISTER_SCRIPTFUNCTION_NS(System, sleep, &Utility::Sleep);
 
 String ScriptUtils::CastString(const Value& value)
 {



More information about the icinga-checkins mailing list