![]() ![]() Hoping that approved wiki-copy-pasted Gibbs will be moderated some way.ĮDIT1: it's nice idea to check the repo if you need to prevent rollbar to notify on js. My answer is based on solution (?), that wasn't working for me. use sidekiq, delayed_job or whatever you want, don't forget to check related wikis. That's also the main reason I recommend to send data asynchronously, i.e. I hope someone will share an optimized version of my code. Last thing I want to say - my solution is not very optimal, but it just works. I use just crawler in array to prevent notifing for both of them. Yet another example of working part: there are crawler and crawler4j on my production site. In my case, I want to know all crawlers on my site, so I came up with this solution. So in regexp you will see a Mail\.RU_Bot, instead of anything wrong.Īlso in your case you can use simply word bot instead of many crawlers, but be careful with unusual user-agents. I did this because I wanted to prevent syntax and escaping related errors of developers in future and add ignorecase thing for same reason. Here I use an array that will be transformed into regexp. Raise Rollbar::Ignore if agent.match?(regexp)īe careful with magic comment frozen_string_literal and use =~ instead of match? if you have Ruby version less than 2.3. Regexp = Regexp.new(Regexp.union(*crawlers).source, Regexp::IGNORECASE)Īgent = options.fetch(:scope).fetch(:request).call.fetch(:headers) brev(0.6.112):brev brew-cask-completion(2.11): brew-gem(1.1.1):brew-gem. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |