mirror of
https://github.com/internetee/registry.git
synced 2025-07-24 19:48:28 +02:00
Add logging to zonefile generating
This commit is contained in:
parent
3bb3bc3aa9
commit
e67217bbb0
1 changed files with 6 additions and 1 deletions
|
@ -9,12 +9,17 @@ class ZonefileSetting < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def self.generate_zonefile(origin)
|
||||
filename = "#{origin}.zone"
|
||||
|
||||
logger.info("-----> Generating zonefile #{filename}")
|
||||
|
||||
zf = ActiveRecord::Base.connection.execute(
|
||||
"select generate_zonefile('#{origin}')"
|
||||
)[0]['generate_zonefile']
|
||||
|
||||
filename = "#{origin}.zone"
|
||||
File.open("#{APP_CONFIG['zonefile_export_dir']}/#{filename}", 'w') { |f| f.write(zf) }
|
||||
|
||||
logger.info("-----> Successfully generated zonefile #{filename}")
|
||||
end
|
||||
|
||||
def to_s
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue