{"action":"created","issue":{"url":"https://api.github.com/repos/liebig/cron/issues/67","labels_url":"https://api.github.com/repos/liebig/cron/issues/67/labels{/name}","comments_url":"https://api.github.com/repos/liebig/cron/issues/67/comments","events_url":"https://api.github.com/repos/liebig/cron/issues/67/events","html_url":"https://github.com/liebig/cron/issues/67","id":85212274,"number":67,"title":"Cron job is running twice","user":{"login":"ichbinedgar","id":5431012,"avatar_url":"https://avatars.githubusercontent.com/u/5431012?v=3","gravatar_id":"","url":"https://api.github.com/users/ichbinedgar","html_url":"https://github.com/ichbinedgar","followers_url":"https://api.github.com/users/ichbinedgar/followers","following_url":"https://api.github.com/users/ichbinedgar/following{/other_user}","gists_url":"https://api.github.com/users/ichbinedgar/gists{/gist_id}","starred_url":"https://api.github.com/users/ichbinedgar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ichbinedgar/subscriptions","organizations_url":"https://api.github.com/users/ichbinedgar/orgs","repos_url":"https://api.github.com/users/ichbinedgar/repos","events_url":"https://api.github.com/users/ichbinedgar/events{/privacy}","received_events_url":"https://api.github.com/users/ichbinedgar/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"liebig","id":3033740,"avatar_url":"https://avatars.githubusercontent.com/u/3033740?v=3","gravatar_id":"","url":"https://api.github.com/users/liebig","html_url":"https://github.com/liebig","followers_url":"https://api.github.com/users/liebig/followers","following_url":"https://api.github.com/users/liebig/following{/other_user}","gists_url":"https://api.github.com/users/liebig/gists{/gist_id}","starred_url":"https://api.github.com/users/liebig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liebig/subscriptions","organizations_url":"https://api.github.com/users/liebig/orgs","repos_url":"https://api.github.com/users/liebig/repos","events_url":"https://api.github.com/users/liebig/events{/privacy}","received_events_url":"https://api.github.com/users/liebig/received_events","type":"User","site_admin":false},"milestone":null,"comments":8,"created_at":"2015-06-04T18:12:00Z","updated_at":"2015-07-15T14:02:40Z","closed_at":"2015-06-12T08:07:53Z","body":"Hi!\r\nI hope you are doing well. I really tried to find answers here in your issues, but I could not find any solution yet. So thats why I opened this issue.\r\n \r\nProblem description:\r\nI have a cron job that sends a test email to my personal inbox, and the problem is that I've received the email twice. I'm using Laravel 4.2.\r\n\r\nSo, in order to see what was the problem, I defined my crontab like this:\r\n* * * * * /opt/lampp/bin/php /opt/lampp/htdocs/myapp/artisan cron:run <- it runs every minute\r\n\r\nand my global.php is like this:\r\n```php\r\n\r\nEvent::listen('cron.collectJobs', function() {\r\n\t\r\n\t\\Cron::add('test', '15 17 * * *', function() {\r\n        // sends email at 17:15 UTC time\t\r\n\t\tMail::send('emails/auth/reminder', array(), function($message)\r\n\t\t{\r\n\t\t\t$message->from('app@app.com', 'gfdgf');\r\n\r\n\t\t\t$message->to('myemail@orgexample.com')->subject('Welcome to My Laravel app! morning!!');\r\n\t\t});\r\n\t\treturn null;\r\n    });\r\n\r\n   /*\\Cron::remove('morning_mail');*/\r\n\t\r\n\t$report = \\Cron::run();\t\r\n\t\r\n});\r\n\r\n```\r\n   \r\nIn theory, or what I expect is that I will receive just one email at 17:15 UTC time, but I received two. \r\n\r\nIn the database, the cron_manager table is saving duplicated entries , for example:\r\n\r\nIDx1 | 2015-06-04 17:54:01 |  0.00\r\nidx2  | 2015-06-04 17:54:01 |  0.00\r\n \r\nand it's happening the same issue on the cron_job table as well.\r\n\r\nI've read this comment (https://github.com/liebig/cron/issues/52) :\r\n\r\n\"Have a look at the cron_manager and cron_job database tables. If you find more than one entry in the cron_manager table for your defined time interval, you probably execute Cron too often. If you find more than one entry in the cron_job table for a manager id, your probably call your send-mail-function too often. Otherwise have a look at your send-mail-function. Maybe it sends the mail twice?\"\r\n\r\nIt's something very similar to my case, but I don't know how to avoid execute cron too often. I tried to only excute the cronjob at some specific time and it didn't work. Also, as you saw in my previous code, I think the issue is not related to the send-mail-function.\r\n\r\nWell, thats it. Let me know if my explanation was not clear. \r\nThank you!!! :)\r\n\r\n "},"comment":{"url":"https://api.github.com/repos/liebig/cron/issues/comments/121625047","html_url":"https://github.com/liebig/cron/issues/67#issuecomment-121625047","issue_url":"https://api.github.com/repos/liebig/cron/issues/67","id":121625047,"user":{"login":"ichbinedgar","id":5431012,"avatar_url":"https://avatars.githubusercontent.com/u/5431012?v=3","gravatar_id":"","url":"https://api.github.com/users/ichbinedgar","html_url":"https://github.com/ichbinedgar","followers_url":"https://api.github.com/users/ichbinedgar/followers","following_url":"https://api.github.com/users/ichbinedgar/following{/other_user}","gists_url":"https://api.github.com/users/ichbinedgar/gists{/gist_id}","starred_url":"https://api.github.com/users/ichbinedgar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ichbinedgar/subscriptions","organizations_url":"https://api.github.com/users/ichbinedgar/orgs","repos_url":"https://api.github.com/users/ichbinedgar/repos","events_url":"https://api.github.com/users/ichbinedgar/events{/privacy}","received_events_url":"https://api.github.com/users/ichbinedgar/received_events","type":"User","site_admin":false},"created_at":"2015-07-15T14:02:40Z","updated_at":"2015-07-15T14:02:40Z","body":"Hi liebig! \r\nNice, you figured it out, don't worry.\r\nThanks for let me know  :)"}}