From ada8a13ce8a3410f4260601d213404bff5fa1cc7 Mon Sep 17 00:00:00 2001 From: Evgeny Zinoviev Date: Fri, 26 Feb 2021 03:40:02 +0300 Subject: initial --- example/create-tasks.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 example/create-tasks.php (limited to 'example/create-tasks.php') diff --git a/example/create-tasks.php b/example/create-tasks.php new file mode 100644 index 0000000..35968a9 --- /dev/null +++ b/example/create-tasks.php @@ -0,0 +1,17 @@ +real_connect('10.211.55.6', 'jobd', 'password', 'jobd')) + die('Failed to connect.'); + +$target = 'server1'; +$slots = ['low', 'normal', 'high']; + +for ($i = 0; $i < 100; $i++) { + $slot = $slots[array_rand($slots)]; + $time = time(); + if (!$db->query("INSERT INTO jobs (target, slot, time_created, status) VALUES ('$target', '$slot', $time, 'waiting')")) + echo "{$db->error}\n"; +} + +$db->close(); \ No newline at end of file -- cgit v1.2.3