Make it possible to change time before sending a mail per machine

This commit is contained in:
Hannes Verschore 2014-01-03 16:14:27 +01:00
Родитель 73d7e91467
Коммит c1a3c5c5f4
2 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

@ -201,6 +201,7 @@ CREATE TABLE `awfy_machine` (
`description` varchar(255) NOT NULL,
`active` tinyint(1) NOT NULL,
`last_checked` int(10) unsigned NOT NULL,
`timeout` int(11) unsigned NOT NULL,
`contact` mediumtext NOT NULL
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

Просмотреть файл

@ -16,16 +16,15 @@ awfy.Startup()
config = ConfigParser.RawConfigParser()
config.read('/etc/awfy-server.config')
machine_timeout_minutes = int(config.get('general', 'machine_timeout'))
c = awfy.db.cursor()
c.execute("select id, description, last_checked, contact from awfy_machine where active = 1")
c.execute("select id, description, last_checked, timeout, contact from awfy_machine where active = 1")
machines = c.fetchall()
for machine_row in machines:
machine_id = machine_row[0]
machine_description = machine_row[1]
machine_last_checked = machine_row[2]
machine_contact = machine_row[3]
machine_timeout_minutes = machine_row[3]
machine_contact = machine_row[4]
# Find the last time this machine submitted any data.
c.execute(