Open Cysioland opened 9 years ago
Script, that just pings the server, and, if nothing fails just spits out the output of your library, runs just kinda slow.
Script code:
#!/usr/bin/env ruby require 'pushbullet' require 'takumi/server_list_ping' begin puts Takumi::ServerListPing.ping("[cut]", 25565) puts "Serwer trybi" rescue Pushbullet.set_access_token '[cut]' Pushbullet::V2::Push.note 'Awaria BluCraft', $! puts 'Wiadomość wysłana' end
time ./scriptname.rb: 0.25user 0.11system 0:30.44elapsed 1%CPU (0avgtext+0avgdata 14676maxresident)k
0.25user 0.11system 0:30.44elapsed 1%CPU (0avgtext+0avgdata 14676maxresident)k
try timeout option
Takumi::ServerListPing.ping("[cut]", 25565, timeout: 10)
Script, that just pings the server, and, if nothing fails just spits out the output of your library, runs just kinda slow.
Script code:
time ./scriptname.rb:
0.25user 0.11system 0:30.44elapsed 1%CPU (0avgtext+0avgdata 14676maxresident)k