Permalink
Browse files

remove dead Countinual code

  • Loading branch information...
pushcx committed Nov 27, 2017
1 parent 91ded85 commit 83b0cced0a3568acd7c6ef1ddcd93a83c6e9cc0d
@@ -51,10 +51,6 @@ def signup
flash[:success] = "Welcome to #{Rails.application.name}, " <<
"#{@new_user.username}!"
Countinual.count!("#{Rails.application.shortname}.users.created", "+1")
Countinual.count!("#{Rails.application.shortname}.users.total",
User.count)
return redirect_to "/signup/invite"
else
render :action => "invited"
@@ -18,9 +18,6 @@ def create
if @story.valid? && !(@story.already_posted_story && !@story.seen_previous)
if @story.save
Countinual.count!("#{Rails.application.shortname}.stories.submitted",
"+1")
return redirect_to @story.comments_path
end
end
View
@@ -19,7 +19,7 @@ class Comment < ActiveRecord::Base
end
after_create :record_initial_upvote, :mark_submitter,
:deliver_reply_notifications, :deliver_mention_notifications,
:log_to_countinual, :log_hat_use
:log_hat_use
after_destroy :unassign_votes
scope :active, -> { where(:is_deleted => false, :is_moderated => false) }
@@ -369,10 +369,6 @@ def log_hat_use
m.save!
end
def log_to_countinual
Countinual.count!("#{Rails.application.shortname}.comments.submitted", "+1")
end
def mark_submitter
Keystore.increment_value_for("user:#{self.user_id}:comments_posted")
end
View
@@ -74,7 +74,7 @@ def root_url
})
end
# used as mailing list prefix and countinual prefix, cannot have spaces
# used as mailing list prefix, cannot have spaces
def shortname
name.downcase.gsub(/[^a-z]/, "")
end
View
@@ -1,34 +0,0 @@
require "socket"
class Countinual
cattr_accessor :API_KEY
# this needs to be overridden in config/initializers/production.rb
@@API_KEY = nil
COUNTINUAL_HOST = "170.130.139.180"
COUNTINUAL_PORT = 1025
def self.count!(counter, value, time = nil)
if !@@API_KEY
return
end
if time
time = time.to_i
else
time = Time.now.to_i
end
line = "#{@@API_KEY} #{counter} #{value} #{time}\n"
begin
sock = UDPSocket.open
sock.send(line, 0, COUNTINUAL_HOST, COUNTINUAL_PORT)
rescue => e
Rails.logger.info "Countinual error: #{e.message} (#{line.inspect})"
ensure
sock.close
end
end
end

0 comments on commit 83b0cce

Please sign in to comment.